freeCodeCamp Challenge Guide: Override Class Declarations by Styling ID Attributes

freeCodeCamp Challenge Guide: Override Class Declarations by Styling ID Attributes
0

#1

We can use id to override styling too. id should have a higher priority than class, so its rules apply if a conflict occurs.

<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
  #orange-text{color:orange;}
</style>
<h1 class="pink-text blue-text" id="orange-text">Hello World!</h1>![image|690x301](upload://yUHeA4wukQeGfKp6ArJVWuYzaT6.png)

#2
body { background-color: black; font-family: Monospace; color: green; } .pink-text { color: pink; } .blue-text { color: blue; } #orange-text { color: orange; }