Book HomeCascading Style Sheets: The Definitive GuideSearch this book Wednesday 13th of December 2017 08:04:20 PM

7.8. Summary

The ability to apply margins, borders, and padding to any element is one of the things that sets CSS so far above traditional Web markup. In the past, enclosing a heading in a colored, bordered box meant wrapping the heading in a table, which is a really bloated and awful way to create so simple an effect. It is this sort of power that makes CSS so compelling.

Unfortunately, this is also one of the areas where CSS support failed us in early implementations. Explorer 3 and Navigator 4 both had poor implementations of the box properties, although Navigator 4's bugs are almost legendary and are certainly close to being epic in nature. As the year 2000 dawned, however, the situation was rapidly improving, thanks to Explorer 4 and 5, and Opera 3.6 (and later).

List styles, on the other hand, were fairly well supported from the very beginning of CSS implementations. The ability to set images for bullets was missing from many early user agents, but support for the various kinds of counting schemes has long been evident.

Although this chapter attempted to provide a clear view of how the box properties work, there are many nuances and details to the CSS formatting model. Including all of them would have dramatically slowed down the progress of the chapter. Instead, these are all covered in the next chapter, which is largely theoretical in nature but which provides a comprehensive explanation of the workings of the CSS formatting model.



reached F, the next number is 10. Thus, a childlearning to count in hex would learn this basic progression:

I realize that it may be a bit weird to think of letters as numbers,but that's how it works in hex. The digits Athrough F are actually just symbols -- theycould have been anything. Someone just decided that letters would beeasier to remember than invented symbols... plus nobody would have toinvent new names for letters.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

11.1.3. Case 3: Putting a Magazine Article Online

Finally, we turn to the situation faced by the editorial offices of Meerkat Monthly. This specialist magazine examines the issues of raising a suricate in a domestic environment, away from others of its kind, and also provides general information about the animals themselves. In an effort to boost sales, the editors want to put a few articles online each month.

H2 {margin-left: 3em; margin-bottom: 2em; margin-right: 0; margin-top: 0;}

As we see in Figure 7-15, the margins were set as wewanted them.

Figure 7-15. More than one single-side margin

However, in this case, it might have been easier to usemargin after all:

H2 {margin: 0 0 2em 3em;}
implementation-specific limits." User agents aren't required to support this type of effect.

7.5.4. Padding: Known Issues

In the first place, padding and Navigator 4.x just plain don't get along. The main problem is that you can set padding on an element with a background color, but the background won't extend into the padding unless you get very sneaky. You need to add a border, as You can terminate list items with a </LI> tag but it'snot required. Can you nest sub-lists within lists? Soitanly! Levels aredifferentiated by indent and bullet or number styleOrdered lists let you specify TYPE and an ordinal VALUE for a listor any individual list item: In-Line Images

Okay, now that you know how to format text on the page, let's includesome in-line images.  The web supports images in GIF, JPEGor PNG formats. GIFs can have up to 256 colors.  JPEGs and