| < Day Day Up > |
|
Previously in this chapter, we've explored two simple ways to minimize our markup using descendant selectors and tossing out unnecessary <div> tags.
Using descendant selectors eliminates the need for adding extraneous class attributes that will further muck up our markup. And eliminating <div> tags where a preexisting block-level element exists just below it can save us added bytes as well as lessen the code it takes to build complex layouts.
While it may seem trivial to save just a few characters by using these methods once over an entire website, these savings start to add up. Call it yet another tool for creating lean, structured markup.
With that lean markup, we also looked at how descendant selectors can be used to style a site map that is structured with nested unordered lists. Each level of the outline can be styled uniquely without the need for extra class attributes—again saving bytes and making it easier to update and restyle in the future. Yay for compact code!
| < Day Day Up > |
|