The Generic code


Practically any formatting HTML tag can be assigned a style sheet definition. The generic code for any style sheet definition goes like this:

tagname { command:value }

If more than one style is to be assigned, they are divided by semicolons:

tagname { command1:value1; command2:value2 }

Blanks and line breaks don't play any role here: Anything between the brackets will be interpreted as part of the style. For example, a C programmer would probably use this notation:

tagname {
   command1: value1
   command2: value2
}

In case of a style definition within a single tag, use this code:

<tag style="command1:value1; command2:value2">

The quotation marks are important here.

NOTABENE: If you enter HTML code by hand, you'll probably often type equals instead of a colon just because you're used to it. It won't work! Any typo anywhere within the style definition (i.e. between the brackets) will cause the definition to be ignored by the browser. If your style sheets don't seem to work even after having eliminated the possibility of a chached older version being displayed, you should check the code for typos.


back to including style sheets
next chapter: formatting text


MAIN PAGE | HELP LINKS | FAQ | HOMEPAGE RESOURCES | STYLE SHEETS


This page was prepared by Yoshiwara


This page is hosted by Geocities Get your own Free Home Page
1