Declaration block

noun

say it: “dek-luh-RAY-shun BLOK” /ˌdɛkləˈreɪʃən blɑk/

Everything between a CSS rule's opening and closing curly braces: the list of declarations that apply to the elements the selector picked.

What is a declaration block?

A declaration block is the part of a rule inside the curly braces: all the declarations that apply to the selected elements.

.card {
  padding: 16px;
  border: 1px solid #ddd;
}   /* the block is everything between { and } */

In a sentence

  • “The declaration block for .menu-card holds five lines: a background, a border, padding, margin and a width.”

Level: Novice · More CSS terms at this level

Updated