Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

How to target a braille / screen-reader via CSS

I'm using a webfont to display icons on a website. It works great visually — scalable, printable, and lightweight.

But there's a big accessibility issue: screen readers interpret them as regular characters.

For example, this code:

<span>i</span> Info 
<span>t</span> Contact

Looks fine to sighted users, but a screen reader reads it as "iInfo", "tContact", etc. — which is confusing.

My question:

Is there a way to target only screen readers (or braille devices) via CSS?

I came across this W3C spec: http://www.w3.org/TR/CSS2/media.html#media-types

...but I'm unsure if it actually works in real-world scenarios.

Update (based on tests):

:before / :after → Some screen readers (e.g., macOS VoiceOver) do read the content out loud.

@media braille, speech → No effect on VoiceOver (tested in Safari & Chrome).

speak: none; → No noticeable effect in VoiceOver or NVDA (confirmed).

Has anyone found a reliable way to hide visual-only icon fonts from screen readers?

Answer*

Draft saved
Draft discarded
Cancel
3
  • 1
    ah this is a pretty sexy solution. In this way blind people could skip the icon and at least its announced as such Commented Dec 13, 2011 at 10:01
  • 1
    Interesting. What does Mac OS X do with it? Commented Dec 14, 2011 at 1:55
  • 1
    @stringy macos reads it out loud like everything else... :/ But still, i think its the best solution until now... Commented Dec 14, 2011 at 8:53

lang-html

AltStyle によって変換されたページ (->オリジナル) /