docs.rodeo

MDN Web Docs mirror

CSS Declaration

{{DefaultAPISidebar("CSSOM")}} 

A CSS declaration is an abstract concept not exposed as an object in the DOM. It represents a CSS property and value pairing.

A CSS declaration has the following associated properties:

Basic example

The following example shows a CSS rule with a CSS declaration block for the {{htmlelement("Heading_Elements","<h1>")}}  element. The CSS declaration block is the lines between the curly braces, it contains two CSS declarations. One for {{cssxref("font-style")}}  and another for {{cssxref("color")}} .

h1 {
  font-style: italic;
  color: rebeccapurple;
}

Specifications

{{Specifications}} 

In this article

View on MDN