Quick HTML

CSS syntax

A style sheet can define a variety of graphic properties. A style property can be assigned to:

  • one element

    H1 { color: red; }
    Meaning: "H1 has always this colour (red)".
    <H1>H1 is always red.</H1>

  • more elements

    H1, P { color: green; }
    Meaning: "H1 and P have always this colour (green)".
    <H1>H1 is always green.</H1>
    <P>P is always green too.</P>

  • a class

    We can think to a class as to a family of members with common features.
    .pur { color: purple; }
    Meaning: "Any member of the class "pur" has this colour (purple)".
    <BLOCKQUOTE class="pur">This citation is purple.</BLOCKQUOTE>
    <P class="pur">This text is purple.</P>

  • a member of a class

    H1.blu { color: blue; }
    Meaning: "<H1 class="blu"> use this colour (blue)".
    <H1 class="blu">This title is blue.</H1>
    <H1>This title is not blue.</H1>

Next page :

how to use DIV or SPAN tags to define the graphic properties of a section of the page.

|   Back   |   Index   |   Next   |