Book Home Monday 23rd of October 2017 02:44:02 AM Cascading Style Sheets: The Definitive GuideSearch this book

Full Text Search

If you are having difficulty searching, or if you have not used this search

<BODY TEXT="black" LINK="#808080" ALINK="silver" VLINK="#333333">
BODY {color: black;}     /* replacement CSS */
A:link {color: #808080;}
A:active {color: silver;}
A:visited {color: #333333;}
Figure 6-3

Figure 6-3. Replacing BODY attributes with CSS

While this may seem like a lot of extra typing, consider that using the old method of BODY attributes, you could only make changes at the document level. For example, if you wanted some links to be medium gray and others a relatively dark gray, you utility before, please read this.


Library Navigation Links

Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

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;margin-left: auto;}

If you want to overcome this space, you can always use negativemargins. Here's one possible declaration:

H1 {margin-bottom: 0;}P {margin-top: -1em;}

The problem with this solution arises when the document is viewed inInternet Explorer, which will displaywhat's shown in Figure 7-27. The overlappingtext is not a mistake on Explorer's part -- it's doingexactly as you specified. Basically, there isn't an easy way to

9.3. Absolute Positioning

Sincemost of the examples and figures in the chapter (besides the previoussection) have been examples of absolute positioning, we'realready halfway to an understanding of how it works. Most of whatremain are the details of what happens when absolute positioning isinvoked.

When an element is positioned absolutely, it is completely removedfrom the document flow. It is then positioned with respect to its

In case you're wondering, there is no way to control the repeatany more than we've already discussed. There is norepeat-left, for example, although it couldcertainly be added in some future version of CSS. For now, you getfull tiling, horizontal tiling, vertical tiling, or no tiling at all.

6.2.4.1. Repeating: Real-world issues

There are a few things to keep in mind when it comes to web browsers. var is_nav4 = (is_nav && (is_major == 4)); if (is_nav4) {onresize = location.reload();} </SCRIPT>

This should cause the document to be reloaded whenever the browser window is resized in any version of Navigator 4.

The script used for this trick was adopted from a technique presented in the Netscape Developer's Edge article "Determining Browser Type and Version with JavaScript" at (http://developer.netscape.com:80/docs/examples/javascript/browser_type.html).