Home   All Products  |   Support  |   Search  | Home  

Microsoft Typography | Typography on the Web | Specifying fonts... | CSS terminology next


Style properties can be applied to HTML elements at the block level and at the text or inline level. Block level elements are those that usually cause paragraph breaks. These include H1 to H6 (headings), P (paragraphs), and LI (list items). Text level elements include EM, STRONG and CITE as well as B, I and A (hypertext anchors). In CSS1 HTML elements are known as selectors.

CSS1 supports more than 35 different properties which can be applied to selectors. Properties include background (color or graphic), font-size, font-weight, line-height (leading or interlinear spacing), font-family, letter-spacing and word-spacing. A property and its associated value is known as a declaration. The combination of a declaration and a selector is known as a rule.

rule :  

P { font-size: 10pt }

selector :  


declaration :  

{ font-size: 10pt }

property :  


value :  


Selectors can be grouped, separated by commas:

H1, H2, H3 { font-family: Arial }

Declarations can also be grouped, separated by semicolons:

H1 { font-weight:  bold; 
     font-size: 10pt;
     line-height: 12pt;
     font-family: Georgia }

To help reduce the size of style sheets, elements inherit properties from higher level elements. The top-level element of an HTML page is its BODY which can also be used as a selector. Properties applied to the BODY will be inherited by lower level block and inline elements unless they are overturned by a subsequent rule.

BODY { color: blue }
H1 { color: red }

This would result in all text being rendered in blue apart from H1 text which would be rendered in red. Likewise inline elements will inherit their properties from the block element in which they reside. In the following line of HTML the EM enclosed inline element will inherit its color from the parent H1 block element.

<H1> our <EM>secret</EM> world </H1> 

Unless its inheritance is overturned by a subsequent rule:

BODY { color: blue }
H1   { color: red }
EM   { color: green }

CSS1 provides several special selectors, CLASS and ID. CLASS is discussed in the following section.

this page was last updated 30 June 1997
© 1997 Microsoft Corporation. All rights reserved. Terms of use.
comments to the MST group: how to contact us


Microsoft Typography | Typography on the Web | Specifying fonts... | CSS terminology next