CSS Html Question 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

CSS Html Question 2

Question: Why is "New Developments" orange and not purple? <!doctype html> <style> .headline{ color:orange; } article{ color:purple; font-style: normal; } </style> <div> <article> <h4 class="headline">New Developments</h4> </article> </div> </html>

9th Jul 2018, 6:05 PM
Stefan du Toit
Stefan du Toit - avatar
1 Answer
+ 10
Class selectors (.headline) are more specific than type selectors (article). About specificity: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
9th Jul 2018, 6:18 PM
NezhnyjVampir