views:

393

answers:

3

I made a css menu with css sprites but the problem is with sprite we don't use inline image we use in background only so if images are disabled in browser then nothing will show . any solution for this ?

For example :

See this menu and turn off images : http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html (it will not be seen if images are disabled in browser)

this menu is against on this quote

Ensure your website works with images disabled

Creating a site that relies too heavily on images is never a good

idea. Although almost a thing of the past, there are still users who run at very low internet speeds. Also, if a user needs to—for whatever reason—disable images, can they still access all the content they need to?

http://csswizardry.com/quick-tips/#tip-02

Shouldn't we use this type of navigation.

A: 

Why would you need alt texts in a menu?

innaM
for accessibility reason if images is disabled navigation should be accessible
metal-gear-solid
Does that mean your menu consists entirely of background images? No text?
innaM
No i have link text but text is hidden by css text-indent property
metal-gear-solid
If the text is hidden by text-indent, screen readers are still able to read it.
Andrew Moore
But people without screen readers are not
David Dorward
I get the feeling that alt-text is the last thing you should worry about.
innaM
+7  A: 

Don't use sprites for content images. They depend on being background-images in the presentation layer (CSS). Put your content in the content layer (the HTML).

David Dorward
I'm not asking for content images.
metal-gear-solid
The images have words on them. The words convey information. Users need the information in order to know where the link goes. **That is content!**
David Dorward
@David Dorward Then shouldn't we use this type of menu http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html
metal-gear-solid
@David Dorward -in this menu . content is available on content layer but it only can be seen when images are enabled and css is disabled. but in case of images disabled in browser by user then nothing will be seen
metal-gear-solid
+2  A: 

You can create a 1x1 transparent pixel image and put it within the div that has the sprite. For example:

<style type="text/css">
#linkContainer {background:url(images/sprite.gif) 0 50 no-repeat}
//sprite selection width/height, set cursor to pointer so users know its a link
#linkContainer img {width:50px;height:25px;cursor:pointer}  
<style>
<div id="buttonContainer"><img src="pixel.gif" alt="Your alt text"></div>
qwertypants
i'm using sprite on drop down menu http://www.cssgirl.com/examples/css-sprites-son-of-suckerfish-dropdown.html this menu is not accessible if images is disabled by user
metal-gear-solid
If images are disabled, the 1x1 clear pixel image will do it's job. The purpose of the pixel image is to only produce an alt tag if a user has images disabled (it's transparent, so it won't be "seen" anyway). I tested your site with images disabled, the drop down menu still shows up if you know where to hover over. Having the pixel image in place will give users a visual que to where the actual menu is.
qwertypants
but in that case we need to remove link text which is useful for SEO and screen reader<a title="my link" href="http://myurl.html">link text</a>
metal-gear-solid