Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
{% example html %}
<pclass="text-muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
<pclass="text-primary">Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<pclass="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
<pclass="text-info">Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
<pclass="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
<pclass="text-danger">Donec ullamcorper nulla non metus auctor fringilla.</p>
{% endexample %}
<divclass="bs-callout bs-callout-info">
<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>
<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>
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.
{% example html %}
<divclass="bg-primary">Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
<divclass="bg-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</div>
<divclass="bg-info">Maecenas sed diam eget risus varius blandit sit amet non magna.</div>
<divclass="bg-warning">Etiam porta sem malesuada magna mollis euismod.</div>
<divclass="bg-danger">Donec ullamcorper nulla non metus auctor fringilla.</div>
{% endexample %}
<divclass="bs-callout bs-callout-info">
<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>
<h4>Conveying meaning to assistive technologies</h4>
<p>As with <ahref="#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>
Use a generic close icon for dismissing content like modals and alerts. **Be sure to include screen reader text when you can** as we've done with `.sr-only`.
Easily clear `float`s by adding `.clearfix`**to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin.
Hide any HTML element with the `[hidden]` attribute. Previously, v3.x included a `.hidden` class that forced toggled content. However, we removed it due to conflicts with jQuery's `hide()` function. It's taken from [PureCSS](http://purecss.io).
Furthermore, `.invisible` can be used to toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document.
The `.invisible` class can be used to toggle only the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document.
Hide an element to all devices **except screen readers** with `.sr-only`. Combine `.sr-only` with `.sr-only-focusable` to show the element again when it's focused (e.g. by a keyboard-only user). Necessary for following [accessibility best practices](../getting-started/#accessibility). Can also be used as mixins.