Book HomeCascading Style Sheets: The Definitive GuideSearch this book Monday 21st of April 2014 09:15:20 AM
then absolutely position one of its children, as shown in Figure 9-23.

Figure 9-23

Figure 9-23. Nested absolutely positioned elements

The small box B in the lower-left corner of the element A is a childof A, which is in turn a child of a relatively positionedDIV. B was absolutely positioned, as was elementA, using styles like these:

DIV {position: relative;}P.A {position: absolute; top: 0; right: 0; width: 15em; height: auto;

10.6. Borders

In CSS1, there are quite a few properties devoted to setting borders around element boxes, such as border-top-width and border-color, not to mention border itself. CSS2 adds a even more border properties, most of which are aimed at giving the author even more specific control of the borders. Before, it was difficult to set a specific color or style for a given side of the border, except through properties like border-left, and that could require more than one value. The new CSS2 properties address this, and their names are pretty self-explanatory:

border-top-color
border-right-color
border-bottom-color
border-left-color
border-top-style
border-right-style
border-bottom-style
border-left-style


Library Navigation Links

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

line's height (or the height of the linebox) isdetermined by the height of its constituent elements and othercontent (such as text). It's important to understand thatline-height really only applies to inline elementsand other inline content and not to block-level elements. We can seta line-height value for a block-level element, butthe only way this will have any visual impact is by being applied toinline content within that block-level element. Consider thefollowing paragraph, for example:needed to display the content:

<P STYLE="height: 10em;">

In this case, then the extra height is treated somewhat like extrapadding, as depicted in Figure 8-3.

Figure 8-3

Figure 8-3. Setting the height property for block-level elements

If, on the other hand, the height isless than that needed to display the content:

only way content will inherit this line height is if it is inheritedby an inline element. Most text isn't contained by an inlineelement. Thus, if we pretend that each line is contained by thefictional LINE element, then the model works outvery nicely.

8.4.2.1. Generating a line box

Here are