CSS syntax
The CSS syntax has three parts consisting of a selector, property, and a value:
selector {property: value}
-
selector
The selector is the HTML tag that a style will be applied to. For example, the <p> tag for paragraphs or the <h2> heading tag.
-
property
The property is an attribute of the HTML tag that will be affected by the stylesheet definition. For example, the background color of a webpage or the color of links.
-
value
The value that the property of a selector will have. For example, the value of the background color of a webpage can be green or the value of the color of links can be gray.
Example:
body { background-color: gray; }
In the above example, the background color of a document is set to gray.
For more detailed information about CSS syntax, read the CSS syntax lesson.




