* Responsive Web Design: Added hint to Prioritize One Style Over Another Added hint to Prioritize One Style Over Another (https://guide.freecodecamp.org/certifications/responsive-web-design/basic-css/prioritize-one-style-over-another and https://learn.freecodecamp.org/responsive-web-design/basic-css/prioritize-one-style-over-another) * Added </style> in 23 line
1000 B
1000 B
title
| title |
|---|
| Prioritize One Style Over Another |
Prioritize One Style Over Another
We need to create a CSS class called pink-text that gives an our h1 element the color pink.
Solution
Between <style> and </style> create a class called pink-text:
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
.pink-text {
}
</style>
And add in this class color with value of pink:
.pink-text {
color: pink;
}
After, add this class to our h1 element:
<h1 class="pink-text">Hello World!</h1>
Full solution
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
.pink-text {
color: pink;
}
</style>
<h1 class="pink-text">Hello World!</h1>