Browsed by
Month: May 2008

Two classes together

Two classes together

Usually attributes are assigned just one class, but this doesn’t mean that that’s all you’re allowed. In reality, you can assign as many classes as you like! For example: class=”text side” Using these two classes together (separated by a space, not with a comma) means that the paragraph calls up the rules assigned to both text and side. If any rules overlap between the two classes then the class which is below the other in the CSS document will take…

Read More Read More

!important ignored by IE

!important ignored by IE

Normally in CSS whichever rule is specified last takes precedence. However if you use !important after a command then this CSS command will take precedence regardless of what appears after it. This is true for all browsers except IE. An example of this would be:margin-top: 3.5em !important; margin-top: 2em So, the top margin will be set to 3.5em for all browsers except IE, which will have a top margin of 2em. This can sometimes come in useful, especially when using…

Read More Read More

CSS border default value

CSS border default value

When writing a border rule you’ll usually specify the colour, width and style (in any order). For example, border: 3px solid #000 will give you a black solid border, 3px thick. However the only required value here is the border style. If you were to write just border: solid then the defaults for that border will be used. But what defaults? Well, the default width for a border is medium (equivalent to about 3 to 4px) and the default colour…

Read More Read More

Universal selector

Universal selector

The universal selector, written “*”, matches the name of any element type. It matches any single element in the document tree. If the universal selector is not the only component of a simple selector, the “*” may be omitted. For example: * *[LANG=fr] and [LANG=fr] are equivalent. * *.warning and .warning are equivalent. * *#myid and #myid are equivalent.