CSS · CSS Tutorial · Lesson 2
CSS Syntax
Selectors, properties and values.
A CSS rule consists of a selector and a declaration block.
Example
<style>
p {
color: red;
text-align: center;
}
</style>
<p>Hello World!</p>
<p>These paragraphs are styled with CSS.</p>
pis the selector — it points to the HTML element to stylecoloris a property andredis its value- Each declaration ends with a semicolon, and blocks are surrounded by curly braces
Keep reading “CSS Syntax”
Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.