There are a number of very good CSS-related resources available on the Web. Here are some of them.
These resources provide a good overview of what's happening in the world of CSS or otherwise provide you with a broad look at CSS.
When all else fails, you can always use the source, Luke. The specifications contain, albeit in a somewhat terse and not always easily decipherable form, the complete description of how conforming user agents should handle CSS. They also contain a complete CSS parsing grammar and forward-compatible parsing rules, both of which are invaluable to the people who write user agents but of minimal interest to almost everyone else.
This is, officially speaking, the online center of the CSS universe. There are links to the CSS Recommendations, to new ideas under consideration, and to other sites about CSS. There are links to historical style sheet proposals, to information about current usage and implementations of CSS, and more. There are also lists of books about CSS, news of new CSS tools, and many other useful bits of information.
This presents a fairly complete set of pages designed to test any CSS implementation. Each page of the suite tests various aspects of CSS properties, one property per page. The tests were largely developed by the author of this book, Håkon Lie (Opera Software), and Tim Boland (NIST), with many contributions from the CSS community and even the browser vendors themselves. If you're wondering how good your browser is at handling CSS1, this is the place to find out. As of this writing, the Test Suite covers only CSS1, but a CSS2 Test Suite is expected in the near future.
You can save a lot of time and effort simply by running your CSS through a validity checker. This is particularly recommended if you're thinking about asking for help online, because if your CSS contains errors, the first thing the experts will tell you to do is to use a validator. May as well get into the practice first.
If you're having trouble getting your style sheets to work, it might be the result of a typographical error, or some other basic error that is difficult to diagnose. You could spend a long time combing through your styles, exhaustively checking each rule for correctness -- and that's a good exercise, of course -- but you could also have a program do it for you, and simply tell you if it found any errors. The W3C CSS Validator will do exactly that. You can supply it with the URL of a style sheet or document containing styles, or simply paste a block of styles into an flowing content around the float, even though doing so isn't required behavior. Either way, it's probably a bad idea to count on a particular behavior, which makes the utility of negative margins on floats rather limited. Hanging floats are probably fairly safe, but trying to push an element upward on the page is generally a bad idea.
There is one other case where a floated element can run outside of its parent element, and that's when the floated element is wider than its parent. In that case, the floated element will simply input field, and let the validator tell you if your problems are the result of a misspelled color name (or something similar). The chief drawback, for most people, is the technical nature of its reporting. Unless you're already familiar with HTML and CSS, the results you get back may be somewhat confusing.
Similar in nature to the W3C's validator, CSScheck offers much friendlier error messages, which makes it more useful to the beginning author. In addition to indicating the severity of the error with whimsical icons (American-style traffic signals, at last check), CSScheck provides a message detailing each problem, as well as the reason it is a problem. It is possible to learn a great deal about good document authoring practices simply by running a few style sheets through CSScheck and carefully reading its responses.
Copyright © 2002 O'Reilly & Associates. All rights reserved.
We keep visiting the point that HTMLdocuments have an inherent structure. In fact, that's part ofthe problem with the Web today: too many of us forget that documentsare supposed to have an internal structure, which is altogetherdifferent than a visual structure. In our rush to create thecoolest-looking pages on the Web, we've bent, warped, andgenerally ignored the idea that pages should contain information thathas some structural meaning.with the concept of floated elements. Ever since Netscape 1.0, it has been possible to float images by declaring, for instance, <IMG SRC="b5.gif" align="right">. This causes an image to float to the right, and allows other content (text or other images) to "flow around" the image. In the past, this was only possible with images and, in some browsers, tables. CSS, on the other hand, allows any element to float, from images to paragraphs to lists. In CSS, this behavior is accomplished using the property float.