The class selector in CSS is denoted by a period (.) followed by the name of the class. This selector is used to target elements with a specific class and apply styling rules to them.
For example, consider the following HTML code:
```html
<div class="container">
<p>This is a paragraph.</p>
<p class="highlight">This is a highlighted paragraph.</p>
</div>
```
To style the paragraph with the class "highlight", you can use the following CSS code:
```css
.highlight {
color: red;
}
```
In this example, the "highlight" class selector targets the second `<p>` element and sets its color to red.
CSS Class selector
1 answer