2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Style Multiple Elements with a CSS Class
|
|
|
|
---
|
|
|
|
## Style Multiple Elements with a CSS Class
|
|
|
|
|
2019-03-06 20:49:37 +04:00
|
|
|
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
|
|
|
|
We need to applying our ```red-text``` class to the first ```p``` element.
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-03-06 20:49:37 +04:00
|
|
|
### Solution
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-03-06 20:49:37 +04:00
|
|
|
In the opening tag of element ```p``` we need to add ```red-text``` class:
|
|
|
|
|
|
|
|
```css
|
|
|
|
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
|
|
|
|
```
|
|
|
|
|
|
|
|
### Useful links
|
|
|
|
|
|
|
|
- [Class selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors)
|