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.
Also covered in
What to know first
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- HTML elementAn HTML element is a structural or semantic unit of an HTML document, defined by markup and represented in the document tree.
- CSS selectorA CSS selector is a pattern that matches elements in a document according to their names, attributes, relationships, states, or other conditions.
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 (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- CSS rulepart of · A CSS rule consists of a selector and a declaration block that specifies styles for elements matching the selector.
- 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.
Questions about declaration
What is declaration?
A CSS declaration is a property-value pair that specifies one styling instruction.
Which Manning books explain declaration?
CSS in Depth, Second Edition, Web Design Playground, Second Edition, Web Design Playground and Tiny CSS Projects.
What should I know before learning declaration?
Manning books that teach declaration usually introduce CSS, HTML, HTML element and CSS selector first.
What is declaration part of?
Declaration is part of CSS. CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
What are the parts of declaration?
Declaration includes specified value and @property.
What is declaration also called?
Declaration is also called property-value pair.
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.



