Forum Moderators: not2easy
#home-tab a {
background-image: url(images/design/home_tab.gif);
display: block;
margin: 2px 0px 0px;
padding: 0px;
float: left;
height: 35px;
width: 51px;
}
#home-tab a:hover {
background-position: 51px 0px;
}
In the html I do this:
<div id="home-tab"><a href="homelink" title="Go home"><span class="no-text">Home</span></a></div>
And no-text is display:none.
This displays in browsers as I want it to and it displays right in Lynx, but I've got a feeling that search engines might pick up on this as a deceptive spam tactic.
Does anyone know of another way of displaying text for text-only browsers so that i get my image rollovers without text in normal browsers?
It's a valid use of image replacement, and there are an increasing number of sites using it with no ill-effects.
You might want to try something like:
text-indent: -5000px;
instead of display: none; though, as this will be read by screen readers, most of which ignore display: none; and visibility: hidden;
text-indent: -5000px;
Couple that with overflow:hidden and there's gold in them thar hills. ;)
I don't think there's any definitive proof that display:none used for image replacement is a problem, however, note that the design "world" is moving away from display:none for these sorts of things. Image replacement is taking the route suggested by jetboy, and even drop menus as exemplified by the Suckerfish articles on HTMLDog are using positioning properties to make functional CSS drop menus, unlike earlier iterations which used display:none. Does this represent a fact-based fear of using display:none, or merely a conjectural one? Impossible to say. However, I would use the alternative methods, which are just as good and degrade nicely, just in case.
cEM
Display:none (no such thing as display:hidden) is an outright statement to not display the content, and there is some concern (whether founded or not remains to be seen) that SEs have come to recognize it as a means of cloaking (hiding content from the user, but displaying it to the spider).
Again, AFAIK, there has not been any confirmation that display:none is frowned on by the SEs. The concern arises from it prominent(?) use by black hats to keyword stuff their pages. I was simply observing that there seems to be a movement afoot in the design community to avoid using display:none when replacing images or creating drop menus. This could be a case of mass paranoia, or it could be a shift based on slowly rising evidence that SEs don't like it.
BTW, here's another thread [webmasterworld.com] for some more on this topic.
cEM