When I have an element like an anchor
that serves as a logo, I will use negative text-indent value which is huge
a.logo {
background: url(logo.gif) no-repeat;
text-indent: -9999px;
}
So that logo looks like an image, plus the text is not visible.
Also, I need the text in the DOM, so that search engines can find it.
However,
- I don't like huge negative values
- I have seen a big scrollables in scenarios when opening-closing an accordion, on some browsers and tablets
- I have heard that Browser when comes across any measurement value on a DOM Element, per the box model, it draws a box with at least that big value. This can be a performance issue while painting
I have also seen people using transparency techniques, tiniest font-sizes, font-color matching with logo background, etc. But they don't look elegant to me
Are there no semantic or elegant techniques to hide the displayed text from the user still have it in the DOM, even after HTML5 and CSS3?