Useful Small Tricks for CSS Style Sheets

by yangkui on 2007-03-05 16:16:02

? The `ul` tag in Mozilla has a default padding value, while in IE only the margin has a value.

? The same class selector can appear multiple times within a document, whereas an id selector can only appear once. When both class and id are used simultaneously to define CSS for a tag, and there are overlapping definitions, the definition made by the id selector takes precedence.

? Beginners might encounter a situation where for the same tag attribute, setting it to A works correctly in IE, but in Mozilla it must be set to B for proper display, or vice versa.

Temporary solution: Use selectors... Read on...