Override All Other Styles by using Important Help

Override All Other Styles by using Important Help
0.0 0

#1

Tell us what’s happening:
I don’t know how to make the pink-text !important, I tried what it told me to do, but it just doesn’t work.

Your code so far


<style>
  body {
    background-color: black;
    font-family: monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text !important blue-text" style="color: white">Hello World!</h1>

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 10452.96.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/override-all-other-styles-by-using-important


#2

You have to put the important into the css like this:

.pink-text {
color: pink !important;
}

Edit: i might want to add for completeness that ids have higher priority than classes aswell.


#3

Thanks! It works just fine now!