Book HomeCascading Style Sheets: The Definitive GuideSearch this book Monday 25th of July 2016 04:08:39 PM

Copyright © 2000 O'Reilly & Associates, Inc. All rights reserved.

Printed in the United States of America.

Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of a koala and the topic of HTML and XHTML is a trademark of O'Reilly & Associates, Inc.

While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.


explain what's going on here. Since the border doesn'texist, it can't have any width, so the width is automaticallyset to 0 (zero). This may seem completelybackward, but it actually makes a great deal of sense. After all, ifa drinking glass is empty, you can't really describe it asbeing half-full of nothing. You can only discuss the depth of aglass's contents if it has actual contents. In the same way,talking about the width of a border only makes sense in the contextof borders that have some existence.


Library Navigation Links

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

Negativity, of course, always complicatesthe situation. Let's consider an image that is floated to theleft and has left and top margins of -15px . Thisimage is placed inside a DIV that has no padding,borders, or margins. The result will be as shown in Figure 7-70.

Figure 7-70

Figure 7-70. A floating image with negative top and left margins

The math in this situation works out something like this: assume thetop inner edge of the DIV is at the pixel position100. The browser, in order to figure out where the top inner edge of

Even if clients don't support XML natively, it is not a big hindrance. In fact, Java with Servlets (on the server side) can convert XML with stylesheets to generate plain HTML that can be displayed in all web browsers.

Using XML to pass parameters and return values on servers makes it very easy to allow these servers to be web-enabled. A thin server side Java layer might be added that interacts with web browsers using HTML and translates the requests and responses from the client into XML, that is then fed into the server.

XML is totally extensible

By not predefining any tags in the XML Recommendation, the W3C allowed developers full control over customizing their data as they see fit. This makes XML very attractive to encoding data that already exists in legacy databases (by using database metadata, and other schema information). This extensibility of XML makes it such a great fit when trying to get different systems to work with each other.

would be something like what is shown here:

P {position: relative;}   /* establish containing blocks */<B STYLE="position: absolute; top: auto; right: 0; bottom: 0; left: auto;width: 8em; height: 4em;">...</B>
Figure 9-19

Figure 9-19. The effects of absolute positioning

For the most part, the text in both paragraphs looks fairly normal.In the second one, however, the place where the boldface elementwould have appeared is simply closed up, and the positioned textoverlaps the some of the content. There is no way to avoid this,needed to be relatively dark. Not so with CSS; all you need to do is add a class to all anchors that need to be this shade of gray and modify your styles accordingly, with the result seen in Figure 6-4:

BODY {color: black;}
A:link {color: #808080;}      /* medium gray */
A.external:link  {color: silver;}
A:active {color: silver;}
A:visited {color: #333333;}   /* a very dark gray */
Figure 6-4

Figure 6-4. Changing colors of hyperlinks