>> English << | Português | По-русскиZVON > Tutorials > CSS tutorial
>> Example 3 << | Prev | Next | Contents

Description

CSS stylesheets are plain text files which consist one or more rules. Each rule starts with a selector (name of the element to be formatted) which followed by curly brackets "{}". The curly brackets contains individual formatting properties, which are separated by semicolon ";". Properties and their values are separated by column ":". You can see that many properties and its values are self-explanatory.

>> Case 1 <<
HTML SourceCSS stylesheet

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<p>Text</p>
h1 {color:blue; text-decoration:underline}
h2 {color:navy}
h3 {color:olive;}
h4 {color:purple}
h5 {color:maroon}
p  {font-weight:bold; color:red;}

Browser output