Summary
CSS lets you create boxes that not only have rounded or nonsquare corners but that are flexiblecutting down on unnecessary code and separating the design of the box from the content that's being presented. In this chapter, we shared
Here are some points to remember when creating indestructible, rounded-corner boxes:
|
Chapter 6. No Images? No CSS? No ProblemEnsure that content is still readable in the absence of images or CSS.
The first several chapters of this book have addressed flexibility from a
component design
angle and stressed the importance of allowing design to accommodate varying amounts and sizes of content. You can take additional measures to bulletproof your designs and thus provide flexibility in the many
stages
a Web page could be interpreted. When CSS is unsupported or unavailable, is the page still readable? If images are slow to load, or turned off via a
Planning for the worst-case scenario can improve a Web site's
|
A Common Approach
Several months ago, I received an e-mail from a faithful reader of my business site and weblog, SimpleBits. In the e-mail, the reader explained that while he enjoyed reading the site, he often browses the Web with images turned
off
, further explaining that he connects to the Internet via a slow dial-up connection and likes to read content rather than waiting for graphics to load. He's not aloneto speed up an
Figure 6.1. Unchecking the Load Images box in the Firefox browser disables all images.
We'll get back to why the reader was explaining the reason he browses this way in just a minute, but first, it'll be helpful to explain how a tiled image was used on SimpleBits that sat behind all of the site's content.
It's a common approach,
Figure 6.2. The bg.gif image was tiled vertically on top of dark gray to create the columned background of the site.
This single image was tiled vertically from top to bottom, creating the columns and side borders that sat on top of a dark-gray background assigned to the <body> element (Figure 6.3). Figure 6.3. When bg.gif was tiled, it created the white and gray columns that sat behind the page's text content.
So, by declaring a dark gray for the background on the
<body>
, I was
body {
background: #666;
}
The tiled image was assigned to an inner
<div>
that contained all of the pages' content; therefore, it would lay on top of the gray background behind it, creating the white and gray columns for text. This all works rather
Figure 6.4. The dark gray text sits on top of the tiled image.
The problem is when the image isn't there and the site's unbulletproofness (perhaps a new word that I've invented) is exposed. |