Tuesday 25th of July 2017 02:32:40 PM

CSS Style Guide

XHTML: Benefits

Converting from HTML to XHTML is easy, and provides the library with several immediate and long–term benefits:

A painless transition to more advanced technology
The web is moving to XML, a powerfully enabling technology. Writing well–formed, valid XHTML pages is the easiest way to begin this transition. All it takes is learning a few simple rules of XHTML markup.
Cleaner, more logical markup
XHTML brings uniformity to document structure. The rules of XHTML help restore the structural integrity of documents that was lost during the web’s rapid commercial expansion between 1994 and 2001. This is critical for large organizations such as ours, whose web pages must interface with logically–marked–up documents in legacy systems and databases.
Increased interoperability
Unlike old–style HTML pages, valid, well–formed XHTML documents can easily be “transported” to wireless devices, Braille readers and other specialized web environments. Moreover, XHTML’s insistence on clean, rule–based markup helps us avoid the kind of errors that can make web pages fail even in traditional browsers like Microsoft Internet Explorer, Netscape Navigator, and Opera Software’s Opera browser.
Greater accessibility
Because they follow strict rules and avoid non–standard markup, well–authored XHTML pages are more accessible than old–school HTML pages, helping the library comply with U.S. laws and accessibility guidelines.
« XHTML Section Index | XHTML Authoring Tips 'n Tools »

the appropriate distance from the bottom of the DIV. The fact that it overlaps the paragraph doesn't matter, at least not technically.

Now let's consider an example where the margins of a list item, an unordered list, and a heading are all collapsed. In this case, the unordered list and heading will be set to have negative margins:

The larger of the two negative margins (-18px ) is added to the largest positive margin (20px ),

Second, it's possible that you might want to override a certain style from an imported style sheet. Imagine that you're using a server-wide style sheet that floats images. On one particular page, you don't want those images to float. Rather than writing a whole new style sheet, you could simply place IMG {float: none;} in your document's embedded style sheet. Beyond this type of circumstance, though, there really isn't much call to use float: none in your HTML documents.


User agents are not, according to the CSS1 specification, required to fully support negative margins, using the phrase, "A negative value is allowed, but there may be implementation-specific limits." In the world of web browsers, though Navigator 4.x, Explorer 4.x/5.x, and Opera 3.x do permit negative margins:

top: 0; bottom: auto; left: auto; right: 0; width: 33%; height: 45%;

Many of the same principles hold true for widths, of course. Forexample:

top: 100px; bottom: 200px; left: 30%; right: 10%; height: auto; width: auto;

Here, the width of the element is effectively 60% the width of itscontaining block.

As wonderful as all of this is, there arises a serious question.Suppose you have a positioned element that you don't want to be

There are a few things to keep in mind when it comes to web browsers.First is that in Navigator 4 and Internet Explorer 4, tiling onlyhappened down and to the right. If you're using Explorer 4,centering an image in the background and then tiling it would looklike Figure 6-52.

Figure 6-52

Figure 6-52. Incorrect behavior in Internet Explorer 4

Navigator 4 manages to avoid this error by not honoring backgroundpositioning at all, which means that the origin imagealways appears in the top left corner of an