A CSS declaration combines a property name, a colon, and a property value to specify one styling instruction. In h1 { color: crimson; }, color: crimson is the declaration. Declarations appear inside CSS rules alongside a selector, which identifies the elements to style. section 1.3.2 section 1.8
Listing 1.2 Embedded CSS
<!DOCTYPE html>
<html lang="en">
<head>
...
<style>
h1, h2, h3, h4, h5, h6 {
color: crimson;
}
</style>
</head>
<body>
...
</body>
</html>
Use the embedded CSS listing to see several declarations styling all heading elements through one grouped rule. section 1.3.2
Several declarations in one rule
h1 { color: red; font-size: 16px; font-family: sans-serif } Each line changes a different aspect of the heading. The final declaration does not require a semicolon, although earlier declarations are separated with semicolons. section 1.7.2
Keep these browser and maintenance behaviors in mind:
- Write property names and values in the supported American English spellings; invalid declarations are ignored while other valid declarations continue to apply. section 1.3.2
- Choose multiline or single-line formatting according to readability and team preference; neither style is inherently correct. section 1.7.2



