How do you select elements with the class name "test"?
CSS Syntax
.class {
css declarations;
}
More Examples
Example 1
Style all <p> elements with class="slightbook":
p.slightbook {
background-color: yellow;
}
Example 2
This <p> element will be styled according to class="slight" AND to class="book":
<p class="slight book">This paragraph refers to two classes.</p>
Example
Select and style all elements with class="slightbook":
.slightbook {
background-color: red;
}
How do you select all p elements inside a div element?
How do you, group selectors?
What is the default value of the position property?
What happens if you open the external CSS file in a browser?
What does CSS stand for?