Elements of an HTML page must be selected to follow a style rule.A style rule consist of 3 parts;
- a type selector (Normally the HTML tag)
- a property (The attribute you wish to change)
- and a value (Each property can take a value)
i.e. selector {property : value}
e.g. To make a paragraph red, you would use p{color:red}. If the value is 2 or more words, double quotes shoud be used; p{font-family:"sans serif"}
Multiple properties should be separated by a semicolon -
p{text-align:centre; color:blue}
Selectors can be grouped by separating with a comma; h1, h2, h3 {color:red} - makes headings 1 to 3 red
Comments
No comments have yet been made