Mistake in Calculating Specificity for CSS

前端 未结 5 1536
孤街浪徒
孤街浪徒 2021-01-21 15:52

I\'m trying to experiment with CSS.

Here\'s my code http://codepen.io/anon/pen/mJxrdE

Here\'s the html


 
  

        
5条回答
  •  误落风尘
    2021-01-21 16:09

    You are targeting specific elements with the class selectors hence the cascade is overwritten.

    To get a better idea target the elements specifically.

    #first .spinach {
      color: brown;
    }
    

    http://codepen.io/stenmuchow/pen/rVdMjR

提交回复
热议问题