docs.rodeo

MDN Web Docs mirror

CSS properties

A CSS property is a parameter used in a CSS declaration that lets you style certain aspects of selected elements. For example, the {{CSSxRef("opacity")}}  property is used to set the opacity of a selected element, allowing you to control if content behind that element is visible:

/* Set 0.8 opacity on <img> elements */
img {
  opacity: 0.8;
}

Each property has a name (e.g., opacity), a value (e.g., 0.8), and a defined behavior on the rendering of the document. CSS also defines shorthand properties, so you can specify multiple related properties in a single declaration. For example, the {{CSSxRef("margin")}}  property is a shorthand for {{CSSxRef("margin-top")}} , {{CSSxRef("margin-right")}} , {{CSSxRef("margin-bottom")}} , and {{CSSxRef("margin-left")}} , setting the margin of all four sides of an element:

/* Give <img> elements 1rem of margin */
img {
  margin: 1rem;
}

Syntax

selector {
  property: value;
}

Alphabetical index of properties

Standard properties defined by CSS specifications include the following:

Misc

A

B

Border-*

B - C

D - F

G - I

J - M

O - P

Q - S

T - Z

Non-standard properties

Non-standard, or vendor-prefixed properties include the following:

-moz- prefix

-webkit- prefix

Specifications

{{Specifications}} 

See also

In this article

View on MDN