Select and style all elements with class="intro":
More "Try it Yourself" examples below.
The .class selector styles all elements with the specified class.
Version: | CSS1 |
---|
Selector | |||||
---|---|---|---|---|---|
.class | Yes | Yes | Yes | Yes | Yes |
Style all <p> elements with class="hometown":