CSS syntax


Properties
A property (color, margin, font, etc.) is assigned to a selector in order to manipulate its style. Example: color: red;
Selectors
  • HTML elements: P { text-indent: 3em }
  • Class selectors: code.html { color: #191970 }
    with CLASS attributes: <CODE CLASS=html> ... </CODE>
  • ID selectors (with ID attribute): #svp94O { text-indent: 3em }
Inheritance
Main rule: the inner selector inherits the surrounding selector's values unless otherwise modified.

Exceptions: the margin-top property is not inherited, etc.