mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-21 13:24:08 +03:00
give all docs callouts IDs
[skip sauce]
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<button type="button" class="btn btn-link">Link</button>
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-buttons-color-accessibility">
|
||||
<h4>Conveying meaning to assistive technologies</h4>
|
||||
<p>Using color to add meaning to a button only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text of the button), or is included through alternative means, such as additional text hidden with the <code>.sr-only</code> class.</p>
|
||||
</div>
|
||||
@@ -132,7 +132,7 @@
|
||||
<button type="button" class="btn btn-default btn-lg" disabled="disabled">Button</button>
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-buttons-ie-disabled">
|
||||
<h4>Cross-browser compatibility</h4>
|
||||
<p>If you add the <code>disabled</code> attribute to a <code><button></code>, Internet Explorer 9 and below will render text gray with a nasty text-shadow that we cannot fix.</p>
|
||||
</div>
|
||||
@@ -150,11 +150,11 @@
|
||||
<p>
|
||||
We use <code>.disabled</code> as a utility class here, similar to the common <code>.active</code> class, so no prefix is required.
|
||||
</p>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-buttons-disabled-anchor">
|
||||
<h4>Link functionality caveat</h4>
|
||||
<p>This class uses <code>pointer-events: none</code> to try to disable the link functionality of <code><a></code>s, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11. In addition, even in browsers that do support <code>pointer-events: none</code>, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, use custom JavaScript to disable such links.</p>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-buttons-context-usage">
|
||||
<h4>Context-specific usage</h4>
|
||||
<p>While button classes can be used on <code><a></code> and <code><button></code> elements, only <code><button></code> elements are supported within our nav and navbar components.</p>
|
||||
</div>
|
||||
@@ -175,12 +175,12 @@
|
||||
<input class="btn btn-default" type="submit" value="Submit">
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-buttons-anchor-accessibility">
|
||||
<h4>Links acting as buttons</h4>
|
||||
<p>If the <code><a></code> elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate <code>role="button"</code>.</p>
|
||||
</div>
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-buttons-ff-height">
|
||||
<h4>Cross-browser rendering</h4>
|
||||
<p>As a best practice, <strong>we highly recommend using the <code><button></code> element whenever possible</strong> to ensure matching cross-browser rendering.</p>
|
||||
<p>Among other things, there's <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=697451">a bug in Firefox <30</a> that prevents us from setting the <code>line-height</code> of <code><input></code>-based buttons, causing them to not exactly match the height of other buttons on Firefox.</p>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<button type="submit" class="btn btn-default">Submit</button>
|
||||
</form>
|
||||
{% endhighlight %}
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-formgroup-inputgroup">
|
||||
<h4>Don't mix form groups with input groups</h4>
|
||||
<p>Do not mix form groups directly with <a href="/components/#input-groups">input groups</a>. Instead, nest the input group inside of the form group.</p>
|
||||
</div>
|
||||
@@ -57,11 +57,11 @@
|
||||
|
||||
<h2 id="forms-inline">Inline form</h2>
|
||||
<p>Add <code>.form-inline</code> to your <code><form></code> for left-aligned and inline-block controls. <strong>This only applies to forms within viewports that are at least 768px wide.</strong></p>
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-inline-form-width">
|
||||
<h4>Requires custom widths</h4>
|
||||
<p>Inputs and selects have <code>width: 100%;</code> applied by default in Bootstrap. Within inline forms, we reset that to <code>width: auto;</code> so multiple controls can reside on the same line. Depending on your layout, additional custom widths may be required.</p>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-inline-form-labels">
|
||||
<h4>Always add labels</h4>
|
||||
<p>Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the <code>.sr-only</code> class. There are further alternative methods of providing a label for assistive technologies, such as the <code>aria-label</code>, <code>aria-labelledby</code> or <code>title</code> attribute. If none of these is present, screen readers may resort to using the <code>placeholder</code> attribute, if present, but note that use of <code>placeholder</code> as a replacement for other labelling methods is not advised.</p>
|
||||
</div>
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<p>Most common form control, text-based input fields. Includes support for all HTML5 types: <code>text</code>, <code>password</code>, <code>datetime</code>, <code>datetime-local</code>, <code>date</code>, <code>month</code>, <code>time</code>, <code>week</code>, <code>number</code>, <code>email</code>, <code>url</code>, <code>search</code>, <code>tel</code>, and <code>color</code>.</p>
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-input-needs-type">
|
||||
<h4>Type declaration required</h4>
|
||||
<p>Inputs will only be fully styled if their <code>type</code> is properly declared.</p>
|
||||
</div>
|
||||
@@ -198,7 +198,7 @@
|
||||
{% highlight html %}
|
||||
<input type="text" class="form-control" placeholder="Text input">
|
||||
{% endhighlight %}
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-xref-input-group">
|
||||
<h4>Input groups</h4>
|
||||
<p>To add integrated text or buttons before and/or after any text-based <code><input></code>, <a href="../components/#input-groups">check out the input group component</a>.</p>
|
||||
</div>
|
||||
@@ -473,7 +473,7 @@
|
||||
<input class="form-control" id="focusedInput" type="text" value="Demonstrative focus state">
|
||||
</form>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-focus-demo">
|
||||
<h4>Demo <code>:focus</code> state</h4>
|
||||
<p>The above example input uses custom styles in our documentation to demonstrate the <code>:focus</code> state on a <code>.form-control</code>.</p>
|
||||
</div>
|
||||
@@ -493,12 +493,12 @@
|
||||
<h3 id="forms-disabled-fieldsets">Disabled fieldsets</h3>
|
||||
<p>Add the <code>disabled</code> attribute to a <code><fieldset></code> to disable all the controls within the <code><fieldset></code> at once.</p>
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-fieldset-disabled-pointer-events">
|
||||
<h4>Caveat about link functionality of <code><a></code></h4>
|
||||
<p>Our styles use <code>pointer-events: none</code> to try to disable the link functionality of <code><a class="btn btn-*"></code> buttons in this case, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11. So to be safe, use custom JavaScript to disable such links.</p>
|
||||
</div>
|
||||
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-fieldset-disabled-ie">
|
||||
<h4>Cross-browser compatibility</h4>
|
||||
<p>While Bootstrap will apply these styles in all browsers, Internet Explorer 11 and below don't fully support the <code>disabled</code> attribute on a <code><fieldset></code>. Use custom JavaScript to disable the fieldset in these browsers.</p>
|
||||
</div>
|
||||
@@ -564,7 +564,7 @@
|
||||
<h2 id="forms-control-validation">Validation states</h2>
|
||||
<p>Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add <code>.has-warning</code>, <code>.has-error</code>, or <code>.has-success</code> to the parent element. Any <code>.control-label</code>, <code>.form-control</code>, and <code>.help-block</code> within that element will receive the validation styles.</p>
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-form-validation-state-accessibility">
|
||||
<h4>Conveying validation state to assistive technologies</h4>
|
||||
<p>Using these validation styles to denote the state of a form control only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers.</p>
|
||||
<p>Ensure that an alternative indication of state is also provided. For instance, you can include a hint about state in the form control's <code><label></code> text itself (as is the case in the following code example), or associate an additional element with textual information about the validation state with the form control using <code>aria-describedby</code> (see the example in the following section). In the case of an error, you could also use the <code>aria-invalid="true"</code> attribute on the form control.</p>
|
||||
@@ -652,11 +652,11 @@
|
||||
<h3>With optional icons</h3>
|
||||
<p>You can also add optional feedback icons with the addition of <code>.has-feedback</code> and the right icon.</p>
|
||||
<p><strong class="text-danger">Feedback icons only work with textual <code><input class="form-control"></code> elements.</strong></p>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-has-feedback-icon-positioning">
|
||||
<h4>Icons, labels, and input groups</h4>
|
||||
<p>Manual positioning of feedback icons is required for inputs without a label and for <a href="../components#input-groups">input groups</a> with an add-on on the right. You are strongly encouraged to provide labels for all inputs for accessibility reasons. If you wish to prevent labels from being displayed, hide them with the <code>.sr-only</code> class. If you must do without labels, adjust the <code>top</code> value of the feedback icon. For input groups, adjust the <code>right</code> value to an appropriate pixel value depending on the width of your addon.</p>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-has-feedback-icon-accessibility">
|
||||
<h4>Conveying the icon's meaning to assistive technologies</h4>
|
||||
<p>To ensure that assistive technologies – such as screen readers – correctly convey the meaning of an icon, additional hidden text should be included with the <code>.sr-only</code> class and explicitly associated with the form control it relates to using <code>aria-describedby</code>. Alternatively, ensure that the meaning (for instance, the fact that there is a warning for a particular text entry field) is conveyed in some other form, such as changing the text of the actual <code><label></code> associated with the form control.</p>
|
||||
<p>Although the following examples already mention the validation state of their respective form controls in the <code><label></code> text itself, the above technique (using <code>.sr-only</code> text and <code>aria-describedby</code>) has been included for illustrative purposes.</p>
|
||||
@@ -874,7 +874,7 @@
|
||||
|
||||
<h2 id="forms-help-text">Help text</h2>
|
||||
<p>Block level help text for form controls.</p>
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-help-text-accessibility">
|
||||
<h4>Associating help text with form controls</h4>
|
||||
<p>Help text should be explicitly associated with the form control it relates to using the <code>aria-describedby</code> attribute. This will ensure that assistive technologies – such as screen readers – will announce this help text when the user focuses or enters the control.</p>
|
||||
</div>
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
<p class="text-warning">...</p>
|
||||
<p class="text-danger">...</p>
|
||||
{% endhighlight %}
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-helper-context-color-specificity">
|
||||
<h4>Dealing with specificity</h4>
|
||||
<p>Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <code><span></code> with the class.</p>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-helper-context-color-accessibility">
|
||||
<h4>Conveying meaning to assistive technologies</h4>
|
||||
<p>Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the contextual colors are only used to reinforce meaning that is already present in the text/markup), or is included through alternative means, such as additional text hidden with the <code>.sr-only</code> class.</p>
|
||||
</div>
|
||||
@@ -44,11 +44,11 @@
|
||||
<p class="bg-warning">...</p>
|
||||
<p class="bg-danger">...</p>
|
||||
{% endhighlight %}
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-helper-bg-specificity">
|
||||
<h4>Dealing with specificity</h4>
|
||||
<p>Sometimes contextual background classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a <code><div></code> with the class.</p>
|
||||
</div>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-helper-bg-accessibility">
|
||||
<h4>Conveying meaning to assistive technologies</h4>
|
||||
<p>As with <a href="#helper-classes-colors">contextual colors</a>, ensure that any meaning conveyed through color is also conveyed in a format that is not purely presentational.</p>
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-helper-pull-navbar">
|
||||
<h4>Not for use in navbars</h4>
|
||||
<p>To align components in navbars with utility classes, use <code>.navbar-left</code> or <code>.navbar-right</code> instead. <a href="../components/#navbar-component-alignment">See the navbar docs</a> for details.</p>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<h2 id="images-responsive">Responsive images</h2>
|
||||
<p>Images in Bootstrap 3 can be made responsive-friendly via the addition of the <code>.img-responsive</code> class. This applies <code>max-width: 100%;</code> and <code>height: auto;</code> to the image so that it scales nicely to the parent element.</p>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-images-ie-svg">
|
||||
<h4>SVG images and IE 8-10</h4>
|
||||
<p>In Internet Explorer 8-10, SVG images with <code>.img-responsive</code> are disproportionately sized. To fix this, add <code>width: 100% \9;</code> where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.</p>
|
||||
</div>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<h2 id="images-shapes">Image shapes</h2>
|
||||
<p>Add classes to an <code><img></code> element to easily style images in any project.</p>
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-images-ie-rounded-corners">
|
||||
<h4>Cross-browser compatibility</h4>
|
||||
<p>Keep in mind that Internet Explorer 8 lacks support for rounded corners.</p>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<h2 id="tables-striped">Striped rows</h2>
|
||||
<p>Use <code>.table-striped</code> to add zebra-striping to any table row within the <code><tbody></code>.</p>
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<div class="bs-callout bs-callout-danger" id="callout-tables-striped-ie8">
|
||||
<h4>Cross-browser compatibility</h4>
|
||||
<p>Striped tables are styled via the <code>:nth-child</code> CSS selector, which is not available in Internet Explorer 8.</p>
|
||||
</div>
|
||||
@@ -346,7 +346,7 @@
|
||||
<td class="info">...</td>
|
||||
</tr>
|
||||
{% endhighlight %}
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-tables-context-accessibility">
|
||||
<h4>Conveying meaning to assistive technologies</h4>
|
||||
<p>Using color to add meaning to a table row or individual cell only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text in the relevant table row/cell), or is included through alternative means, such as additional text hidden with the <code>.sr-only</code> class.</p>
|
||||
</div>
|
||||
@@ -354,7 +354,7 @@
|
||||
<h2 id="tables-responsive">Responsive tables</h2>
|
||||
<p>Create responsive tables by wrapping any <code>.table</code> in <code>.table-responsive</code> to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.</p>
|
||||
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<div class="bs-callout bs-callout-warning" id="callout-tables-responsive-ff-fieldset">
|
||||
<h4>Firefox and fieldsets</h4>
|
||||
<p>Firefox has some awkward fieldset styling involving <code>width</code> that interferes with the responsive table. This cannot be overriden without a Firefox-specific hack that we <strong>don't</strong> provide in Bootstrap:</p>
|
||||
{% highlight css %}
|
||||
|
||||
@@ -183,7 +183,7 @@ You can use the mark tag to <mark>highlight</mark> text.
|
||||
<em>rendered as italicized text</em>
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-type-b-i-elems">
|
||||
<h4>Alternate elements</h4>
|
||||
<p>Feel free to use <code><b></code> and <code><i></code> in HTML5. <code><b></code> is meant to highlight words or phrases without conveying additional importance while <code><i></code> is mostly for voice, technical terms, etc.</p>
|
||||
</div>
|
||||
@@ -455,7 +455,7 @@ You can use the mark tag to <mark>highlight</mark> text.
|
||||
</dl>
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-callout bs-callout-info">
|
||||
<div class="bs-callout bs-callout-info" id="callout-type-dl-truncate">
|
||||
<h4>Auto-truncating</h4>
|
||||
<p>Horizontal description lists will truncate terms that are too long to fit in the left column with <code>text-overflow</code>. In narrower viewports, they will change to the default stacked layout.</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user