Liron Harel
Liron Harel

Reputation: 11247

Disable sr-only span element using Font Awesome

Font Awesome is adding a hidden span element with the name of the icon in it.

Example:

<span class="sr-only">Camera</span>

How can I tell Font Awesome not to render this element (disable this feature). I am using the official Font Awesome script.

Upvotes: 4

Views: 1582

Answers (1)

Sumon Sarker
Sumon Sarker

Reputation: 2795

If you want to set alternative text, Then you can use aria-hidden="true" attribute.

sr-only is for screen reader purpose. Don't remove it.

You can add custom CSS for change/disable sr-only property.

Here is an Example

.sr-only {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
   clip: rect(0,0,0,0);
   border: none;
}

You can get more details for Font Awesome sr-only class from Here

Upvotes: 4

Related Questions