Tell us what’s happening:
Your code so far
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 class="pink-text" "blue-text">Hello World!</h1>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.
Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/override-styles-in-subsequent-css/
1 Like
This is not how you add second class in an element.
You just add it immediately after first class name followed by space and not in separate quotes.
1 Like
That’s because the class in <h1> is pointing to .pink-text
Try also to write .blue-text next to .pink-text in your h1 (with space, not separetly) and you’ll see how it will override it.
Thank you so much, I edited the code as you guys said and it worked.
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 class=“pink-text blue-text”>Hello World!</h1>
six03
6
Your HTML is wrong. Take out the quotes after pink-text and before blue-text and the blue text will override the pink text.
<h1 class="pink-text blue-text">Hello World!</h1>