CSS Syntax
A rule is written as selector { property: value; }. Each declaration is a property name, a colon, a value and a semicolon. You can put many declarations in one block.
Whitespace and line breaks are ignored, so format your rules for readability. A missing semicolon or brace can silently break the declarations that follow it.
Example
<style>
h2 {
color: crimson;
font-size: 28px;
text-decoration: underline;
}
</style>
<h2>Three declarations</h2>Exercise
Finish the declaration with the right punctuation.
p { color: teal }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.