liveBook · Manning

Declaration

Also called property-value pair

A CSS declaration is a property-value pair that specifies one styling instruction.

How 4 Manning books explain it

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.

Read how Web Design Playground explains declaration →

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.

Read how Tiny CSS Projects explains declaration →

Also covered in

What to know first

Related concepts

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.