Book HomeCascading Style Sheets: The Definitive GuideSearch this book Monday 23rd of October 2017 02:43:20 AM

As previously discussed, if no colors are defined, then the default color is the foreground color of the element. Thus, the following declaration will be displayed as shown in Figure 7-44:

P.shade1 {border-style: solid; border-width: thick; color: gray;}
P.shade2 {border-style: solid; border-width: thick; color: gray;
border-color: black;}

The result is that the first paragraph has a gray border, having taken the value gray from the foreground color of


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.

diverse as the stock and color of the paper used, and even the temperature of the printing mechanism, can affect how well colors are reproduced on paper.

In effect, this is yet another area where you must remember that total control over document appearance is simply not possible. In this case, it's due to a combination of inconsistent operating system settings and the vagaries of human perception, which is an obstacle no computer is going to overcome any time soon.

It is left to individual authors to decide what chances they wish tomargins are collapsed while horizontal margins are not, and theborders and padding default to zero unless explicitly declaredotherwise. Remember, however, that not all replaced elements areimages. Most form elements are replaced, for example.

In general, all replaced elements (block-level or otherwise) can bescaled using height and width.In most other ways, inline replaced elements are handled verydifferently, as we'll see later in this chapter.

Figure 7-79

Figure 7-79. Bullets

In an unordered list, these will be little symbols, but in an orderedlist, the bullet could be a letter or number.

7.7.1. Types of Lists

This part will probably seem very familiarto those of you who have been fiddling with lists in HTML. In orderto change the type of counter or bullet used for a list'sitems, you would use the list-style-type.