What is sr-only in Bootstrap 3?
What is the class
sr-only used for? Is it important or can I remove it? Works fine without.
Here’s my example:
According to bootstrap’s documentation, the class is used to hide information used for screen readers.
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 .sr-only class.
Here is the styling used: (example)
Is it important or can I remove it? Works fine without.
It’s important, don’t remove it.
You should always consider screen readers for accessibility purposes. Usage of the class will hide the element anyways, therefore you shouldn’t see a visual difference.
If you’re interested in reading about accessibility: