What style over rides the other?

Hello,

I was working on this.

I was wondering how the program decides which has the final say for the outputting style. Initially we declare h1 to be maroon but then we declare .title to be teal.

I did a bit of my own research and learned that inline changes override external changes or if you use !important it will override everything else but for the external css file, what would be the final say?

Thanks

2 Likes

Well, what is the output (maroon or teal)? That is the your answer if I’m not mistaken.

2 Likes

I played around with it and figured it out, it also mentions it a few lessons down, thanks!

2 Likes

The end of this list…

  • user agent styles
  • type, pseudo-element styles
  • class, pseudo-class styles
  • id styles
  • style attribute
  • !important
3 Likes