- Use Floats to Achieve Grid-like Results
- A Common Approach
- Why It's Not Bulletproof
- A Bulletproof Approach
- Why It's Bulletproof
- Summary
Why It's Not Bulletproof
For this particular example, the amount of code required could be reason enough for considering a better approach (Figure 4.4). Reducing the code will not only cut down on file size (which in turn will reduce required server space and speed up the downloading of pages), but it will also make the editing of the component from a production standpoint far easier. When we take the time to choose the best markup for the task at hand, the simplified results will be easier for servers and site editors to read and understand. Think of it as flexibility in terms of maintenance as well.
Figure 4.4 Avoid drowning in a sea of code.
Because of the code bloat, the common approach also scores low in terms of accessibility to a wide range of software and devices. Accessing the rigid construction of nested tables and spacer GIF shims that are used to lay out the design with anything but a standard Web browser could certainly prove to be trying for any user. As we'll discover, deflating the code bloat and increasing the accessibility doesn't have to compromise the design.