A Bulletproof Approach


To ensure that your page's text is still readable, even in the absence of images, the bulletproof fix is rather simple. Remember to always provide background color equivalents for any background images that you may use.

For instance, looking back at our unreadable example, if I had simply added background color to content areas of the page, my helpful reader would still be able to view the text without any problems.

Since the content portion of the page sits on top of a white background, I need to add that color to the containing <div > that wraps that column:

 #content {   background: #fff;   } 

Similarly, since the sidebar's text sits on top the light-gray background portion of the tiled image, I just need to declare that color for the <div > that wraps the right column:

 #sidebar {   background: #eee;   } 

Figure 6.6 shows the results of adding those two simple rules to the style sheetwith images still turned off. You'll notice that while the tiled image is gone, each text column has a background color sitting behind it, masking the dark gray default of the entire page.

Figure 6.6. With background colors added, the text is readable once again.




Bulletproof Web Design(c) Improving flexibility and protecting against worst-case scenarios with XHTML and CSS
Bulletproof Web Design(c) Improving flexibility and protecting against worst-case scenarios with XHTML and CSS
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net