HTML and CSS Reference
In-Depth Information
<li><a href="day3.html">Day 3 (Prague Castle)</a></li>
<li><a href="day4.html">Day 4 (up the towers, Karlstejn Castle)</a></li>
<li><a href="day5.html">Day 5 (Metro tour)</a></li>
</ul>
</div>
</div>
</body>
</html>
The result (Figure 7-31) resembles the earlier liquid layout of this page; only the underlying
structure has changed.
Figure 7-31. A variation on the two-column layout using negative margins
Using negative margins can sometimes help you out of a quandary when source order is
important and you have to work around it. However, a layout that uses negative margins in
many places can be extremely difficult to decipher by anyone other than the author. There-
fore, remember to comment your CSS thoroughly, and perhaps include a URL in the comment
pointing to an explanatory page.
Flexibility of CSS Layouts
You might be thinking to yourself, “Heck, this is crazy—why should I bother learning all these
tricks when a table does the job just fine?” The beauty of setting out your pages in this way is
that you are no longer locked into a given layout. If you want to change from one layout to
another, you don't need to modify every page on your web site (which may consist of hundreds
or even thousands of pages); you can simply switch to a different style sheet. In fact, you can
even change the page style using the same style sheet just by changing the id attribute in the
body element (as demonstrated earlier in the section “Changing Layouts at the Flick of
a Switch”).
Search WWH ::




Custom Search