Declaration
A CSS declaration is a property-value pair that specifies one styling instruction.
CSS in Depth, Second Edition
A CSS declaration is a property-value pair that specifies one styling instruction.
- How it is used
- Uses declarations to specify styles and to show how the cascade resolves conflicting instructions.
- How deep it goes
- Defines the property-value syntax, then works through conflicts, source order, and unsupported declarations rather than cataloging properties.
- Examples
- Compares competing heading fonts, a featured navigation link reused elsewhere, and paired solid and transparent background colors.
- What you can do after
- Diagnose/debug with it by identifying competing declarations, checking which selectors match, and recognizing when an unsupported declaration is ignored.
Read how CSS in Depth, Second Edition explains declaration →
Web Design Playground, Second Edition
A CSS declaration is a property-value pair that specifies a presentation setting.
- How it is used
- Specifies presentation settings that browsers apply to selected web page elements.
- How deep it goes
- Defines syntax, grouping, spacing, units, and placement, while deferring the broader methods for adding styles.
- Examples
- Uses `font-size: 36px;` for headings and `display: grid;` for a container.
- What you can do after
- Apply it via CSS syntax to change selected elements’ presentation or activate layout behavior.
Read how Web Design Playground, Second Edition explains declaration →
Web Design Playground
A CSS statement consisting of a property name and a value that assigns a styling instruction.
- How it is used
- Uses property-value pairs to give browsers concrete styling instructions for selected HTML elements.
- How deep it goes
- Defines syntax, placement, grouping, indentation, and repeated application, but defers deeper cascading and specificity details.
- Examples
- Demonstrates font size, text alignment, small capitals, multiple declarations, internal style sheets, and inline style attributes.
- What you can do after
- Builds simple CSS declarations and combines them into rules that style one or many matching HTML elements.
Tiny CSS Projects
A CSS declaration consists of a property name, a colon, and a property value specifying one styling instruction.
- How it is used
- Defines individual styling instructions inside CSS rules for selected elements.
- How deep it goes
- Explains declaration syntax, browser handling of invalid values, formatting choices, and optional final semicolons.
- Examples
- Uses heading rules that set color, font size, and font family, including a grouped rule for multiple heading elements.
- What you can do after
- Apply it via CSS by writing valid property-value pairs inside rules and choosing readable declaration formatting.
Related concepts
- @propertyhas part · The CSS @property at-rule registers a custom property by defining its syntax, inheritance behavior, and initial value.
- CSSpart of · CSS, or Cascading Style Sheets, is a stylesheet language for specifying the presentation and layout of structured documents and user interfaces.
- mixinproduced by · A mixin is a reusable unit of behavior or declarations designed to be composed into classes, objects, modules, or stylesheets.
- grid containerconfigures · A grid container is an element whose display mode establishes a CSS Grid formatting context for laying out its child elements as grid items.
- style propertyhas part · A style property is a named setting or interface attribute that specifies or exposes a presentation characteristic of an element or view.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



