Custom Properties Example
- This document has a background colour that is set using a CSS3 custom property.
- The heading is coloured using a different property.
- The custom properties syntax can also represent other values that can be substitued, e.g. here, measurements are stored in two new variables and used to define margins and padding.
- Custom Properies make changing page layout way simpler when using media queries.
- Custom Properies also respect the cascade, so here the
special
class is more specific than the element styling on li
, so the colour of this line is different.