<ahref="http://fortawesome.com/start?utm_source=font_awesome_navbar&utm_medium=display&utm_content=font_awesome_navbar&utm_campaign=promo_4.7_update"data-toggle="tooltip"data-container="body"data-placement="bottom"data-html="true"title="Take your front end game<br>to the next level!">
<ahref="http://symbolset.com/?utm_source=font_awesome_navbar&utm_medium=display&utm_content=font_awesome_navbar&utm_campaign=promo_4.7_update"data-toggle="tooltip"data-container="body"data-placement="bottom"data-html="true"title="Get the perfect icon set!">
Icons are symbols that can convey a ton of information and really help people comprehend directions, signs, and interfaces. It's important that we create and use them so that they can reach the largest amount of people possible.
Modern versions of assistive technology, like screen readers, will read CSS generated content (how Font Awesome icons are rendered), as well as specific Unicode characters. When reading our default markup for rendering icons, assisistive technology may have the following problems.
<iclass="gg-col fa fa-magic text-muted fa-lg padding-right"aria-hidden="true"></i>
Use Font Awesome CDN's auto accessibility
</h3>
<p><ahref="../get-started/#get-started-cdn">Font Awesome CDN</a> helps you automate accessibility support more easily so your icons work for the most people possible. You only need turn on a setting, <ahref="https://cdn.fontawesome.com/help#qa-autoa11y">use our simple syntax</a>, and any icons you use will have all of the best practices and manual techniques below <strong>applied automatically</strong>.</p>
</div>
<divclass="col-md-4">
<ahref="../get-started/#get-started-cdn"class="btn btn-success btn-block btn-lg margin-top-lg margin-bottom">Automate Your Icons' Accessibility</a>
<pclass="text-sm text-center margin-bottom-none">
<ahref="https://cdn.fontawesome.com/help#qa-autoa11y">Read more about our auto accessibility</a>
<iclass="gg-col fa fa-wrench text-muted fa-lg padding-right"aria-hidden="true"></i>
Manually make your icons accessible
</h3>
<p>When using icons in your UI, there are manual techniques and ways to help assistive technology either ignore or better understand Font Awesome.</p>
<h4class="margin-top-xl">Icons used for pure decoration or visual styling</h4>
<p>If you're using an icon to add some extra decoration or branding, it does not need to be announced to users as they are navigating your site or app aurally. Additionally, if you're using an icon to visually re-emphasize or add styling to content already present in your HTML, it does not need to be repeated to an assistive technology-using user. You can make sure this is not read by adding the <code>aria-hidden="true"</code> to your Font Awesome markup.</p>
Pied Piper, A Middle-Out Compression Solution Making Data Storage Problems Smaller
<spanclass="nt"></h1></span>
</code></pre></div>
<smallclass="text-muted">an icon being used as a logo</small>
</div>
<divclass="margin-bottom-lg">
<divclass="highlight"><pre><codeclass="html"><spanclass="nt"><a</span><spanclass="na">href=</span><spanclass="s">"https://github.com/FortAwesome/Font-Awesome"</span><spanclass="nt">><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-github"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="nt">></i></span> View this project's code on Github<spanclass="nt"></a></span>
</code></pre></div>
<smallclass="text-muted">an icon being used in front of link text</small>
If you're using an icon to convey meaning (rather than only as a decorative element), ensure that this meaning is also conveyed to assistive technologies. This goes for content you're abbreviating via icons as well as interactive controls (buttons, form elements, toggles, etc.). There are a few techniques to accomplish this:
The simplest way to provide a text alternative is to use the <code>aria-hidden="true"</code> attribute on the icon and to include the text with an additional element, such as a <code><span></code>, with appropriate CSS to visually hide the element while keeping it accessible to assistive technologies. In addition, you can add a <code>title</code> attribute on the icon to provide a tooltip for sighted mouse users.
<spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-car"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"Time to destination by car"</span><spanclass="nt">></i></span>
<spanclass="nt"><span</span><spanclass="na">class=</span><spanclass="s">"sr-only"</span><spanclass="nt">></span>Time to destination by car:<spanclass="nt"></span></span>
<spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-bicycle"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"Time to destination by bike"</span><spanclass="nt">></i></span>
<spanclass="nt"><span</span><spanclass="na">class=</span><spanclass="s">"sr-only"</span><spanclass="nt">></span>Time to destination by bike:<spanclass="nt"></span></span>
<divclass="highlight"><pre><codeclass="html"><spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-hourglass"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"60 minutes remain in your exam"</span><spanclass="nt">></i></span>
<spanclass="nt"><span</span><spanclass="na">class=</span><spanclass="s">"sr-only"</span><spanclass="nt">></span>60 minutes remain in your exam<spanclass="nt"></span></span>
<spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-hourglass-half"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"30 minutes remain in your exam"</span><spanclass="nt">></i></span>
<spanclass="nt"><span</span><spanclass="na">class=</span><spanclass="s">"sr-only"</span><spanclass="nt">></span>30 minutes remain in your exam<spanclass="nt"></span></span>
<spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-hourglass-end"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"0 minutes remain in your exam"</span><spanclass="nt">></i></span>
<spanclass="nt"><span</span><spanclass="na">class=</span><spanclass="s">"sr-only"</span><spanclass="nt">></span>0 minutes remain in your exam<spanclass="nt"></span></span>
In the case of focusable interactive elements, there are various options to include an alternative text or label to the element, without the need for any visually hidden <code><span></code> or similar. For instance, simply adding the <code>aria-label</code> attribute with a text description to the interactive element itself will be sufficient to provide an accessible alternative name for the element. If you need to provide a visual tooltip on mouseover/focus, we recommend additionally using the <code>title</code> attribute or a <ahref="https://github.com/chinchang/hint.css">custom tooltip</a> solution.
<divclass="highlight"><pre><codeclass="html"><spanclass="nt"><a</span><spanclass="na">href=</span><spanclass="s">"path/to/shopping/cart"</span><spanclass="na">aria-label=</span><spanclass="s">"View 3 items in your shopping cart"</span><spanclass="nt">></span>
<divclass="highlight"><pre><codeclass="html"><spanclass="nt"><a</span><spanclass="na">href=</span><spanclass="s">"#navigation-main"</span><spanclass="na">aria-label=</span><spanclass="s">"Skip to main navigation"</span><spanclass="nt">></span>
<spanclass="nt"><i</span><spanclass="na">class=</span><spanclass="s">"fa fa-trash-o"</span><spanclass="na">aria-hidden=</span><spanclass="s">"true"</span><spanclass="na">title=</span><spanclass="s">"Delete this item?"</span><spanclass="nt">></i></span>
While the scenarios and techniques here help avoid some serious issues and confusion, they are not exhaustive. There are many complex contexts and use cases when it comes to accessibility, such as users with low vision who need a high color contrast ratio to see UI. There are some great tools and resources to learn from and work on these issues out there. Here are a few reads we recommend.
We'll continue to work on these under the larger topic of accessibility, but in the meantime, <ahref="../community/#reporting-bugs">let us know if any bugs or issues</a>.
Thanks to <ahref="http://tracking.maxcdn.com/c/148092/3982/378/"><iclass="fa fa-maxcdn"></i> MaxCDN</a> for providing the excellent <ahref="https://www.bootstrapcdn.com/fontawesome/">BootstrapCDN for Font Awesome</a>
<h3class="margin text-sans-serif strong">Check out the details on <brclass="hide-sm hide-md hide-lg">Kickstarter <iclass="fa fa-external-link-square"aria-hidden="true"></i></h3>