CSS - Property

> (World Wide) Web - (W3|WWW) > CSS - Cascading Style Sheets - Markup Language (HTML|XML) Skin

1 - Definition

CSS defines a finite set of parameters, called properties, that direct the rendering of a document.

Properties are attached to various parts of the document and to the page on which the document is to be displayed by the mechanisms of:

CSS 2.1 has more than 90 properties. See also: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference


3 - Syntax

Each property has:

  • a name (e.g., 'color', 'font', or border')
  • and a value (e.g., 'red', '12pt Times', or 'dotted').

Each CSS property definition begins with a summary of key information that resembles the following:


  • Value: legal values & syntax
  • Initial: Initial value
  • Applies to: elements this property applies to
  • Inherited: whether the property is inherited from an ancestor element.
  • Percentages: how percentage values are interpreted. If “N/A” appears here, it means that the property does not accept percentages in its values.
  • Media: which media groups the property applies to
  • Computed value: how to compute the Computed value

4 - Shorthand

Some properties are shorthand properties, meaning that they allow authors to specify the values of several properties with a single property. When values are omitted from a shorthand form, each “missing” property is assigned its initial value.

4.1 - Example

For instance, the 'font' property is a shorthand property for setting:

  • 'font-style',
  • 'font-variant',
  • 'font-weight',
  • 'font-size',
  • 'line-height',
  • and 'font-family' all at once.

The multiple style rules of this example:

h1 { 
  font-weight: bold; 
  font-size: 12pt;
  line-height: 14pt; 
  font-family: Helvetica; 
  font-variant: normal;
  font-style: normal;

may be rewritten with a single shorthand property:

h1 { font: bold 12pt/14pt Helvetica }

In this example, 'font-variant', and 'font-style' take their initial values.


5 - Management

5.1 - Suppress

To suppress a property, you have to set its value to initial or unset.

6 - Documentation / Reference

web/css/property.txt · Last modified: 2019/02/09 11:40 by gerardnico