Why are my CSS properties being overridden/ignored?

后端 未结 5 781
名媛妹妹
名媛妹妹 2020-12-03 21:27

I\'m having some issues with the CSS \"hierarchy\" (not sure if it\'s proper to call it a hierarchy). I\'m trying to style the below bit of HTML.



        
5条回答
  •  天涯浪人
    2020-12-03 21:40

    My response should have been a "comment" on the answer, but I have the correct fix although #tibo answered correctly:

    li.post-item > * {
      margin: 0px !important;
    }
    
    .item-description {
      color: #FFF !important;
    }
    
    .item-meta {
      color: #666 !important;
    }
    

    The !important rule will override the order of evaluation between id and class.

    Here is a link to an article, When Using !important is The Right Choice, that will help you to understand... it made my life easier :)

提交回复
热议问题