CSS class priorities

前端 未结 4 1389
深忆病人
深忆病人 2020-12-08 15:13

I have a question about the priority of CSS classes after encountering a problem today. The situation is as follows:

I have an unordered list which has a class assoc

4条回答
  •  春和景丽
    2020-12-08 15:52

    A small addition that was not mentioned by cletus' post.
    According to the W3C link, the highest priority is the style attribute used in the html element/tag.

    E.g. if you have

    foo
    

    and

    
    

    The color will be red because the inline html style has the highest priority, higher than #.

提交回复
热议问题