CSS Syntax
CSS is coded using a Selector with a Property set to a Value.
Selector
body { color: #333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1em; }
The selector contains the CSS keyword that determines what HTML elements or which parts of the HTML file the command affects. Notice that the selector is followed by an open bracket and the entire list of property:value pair sets end with a close curly bracket.
Go to Types of Selectors
Property
body {
color: #333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 1em;
}
The property keywords are marked in red. Note that key property keyword ends with a colon and the whole property:value pair must end with a semi-colon.
Value
body {
color: #333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 1em;
}
The values of the properties are marked in red. Remember to put a semi-colon after each value. Note that each property has specific values you can use. Colors are indicated with a hash mark followed by a 3-digit or 6-digit number representing the hexadecimal value of the RGB values for the color.
