CSS Declarations
Learn how CSS declarations define the presentation applied by a style rule and how property values form the rule's effect.
Basic
What a declaration does
A CSS declaration specifies a property and the value assigned to that property. Declarations are the part of a style rule that describes the presentation to apply to elements matched by its selector.
| |
Here,
color and
margin-block are properties, and each value follows the property name after a colon.
Declarations inside a rule
A declaration block can contain multiple declarations. Each declaration is terminated by a semicolon, allowing several properties to contribute to the same style rule.
| |
Property values matter
A property does not accept an arbitrary value. Each CSS property defines the kinds of values it accepts, and the value determines the result of the declaration when the rule applies.
| |
Thanks for your feedback.
Mark this learning resource complete to track your learning progress.