CSS property (source code)

= CSS property
{c}

A <CSS property> is a defined parameter of presentation or layout, such as `color`, `width` or `margin-left`. Its definition specifies allowed values, an initial value, whether it inherits, and how values are computed. A <CSS declaration> proposes a value for a property on the elements matched by its rule.<CSS Cascading and Inheritance Level 5 by World Wide Web Consortium>[Value Processing and Defaulting: property values, initial values and inheritance]{ref}

For example, `width: 50%` names the width property and supplies a percentage value. If that percentage resolves against a containing width of 400 <CSS pixels>, the resulting width is 200 <CSS pixels> in the simple case. The same declaration in a 600-pixel containing width can yield 300 pixels. A property name therefore identifies a parameter, while its eventual layout value can depend on context.

Different properties have different value grammars and defaulting behavior. A color word can be valid for `color` but invalid for `width`. Foreground color normally inherits, while width does not inherit by default. The absence of a width declaration is therefore different from automatically copying the parent's width.<Assigning property values, Cascading, and Inheritance in CSS 2.2 by W3C>[§§6.1–6.2, assigning property values and inheritance]{ref}

A property also differs from an <HTML attribute> with similar wording. Attribute interpretation is part of the element's document semantics; a <CSS property> participates in the styling value process, including the <CSS cascade>. Keeping the property definition, individual declarations and the resulting <CSS used value> separate makes styling behavior much easier to explain.