Web Design with HTML and CSS

(National Geographic (Little) Kids) #1

68


The role of CSS

Web Design with HTML and CSS Digital Classroom

6 Type the following code below the h1 {:
color:purple;
The word color is referred to as a property in CSS syntax and the word purple is a value.
The combined pair of a property and a value is called a declaration.

The combination of the property (color) and the value (purple) is often referred to as style rule.

7 Press Return again and on the next line, type } which is the right curley bracket
character.
This closes the curley bracket you added in step 4.
You now have three lines in this rule:
h1 {
color:purple;
}
8 Choose File > Save and then preview your page in the browser. The head is now a light
purple color and you have successfully created your fi rst CSS rule. Close your browser
and return to your text editor.

Your H1 color is now being styled by a CSS rule.
Free download pdf