问答详情
源自:9-4 为所欲为 - 选择器最高层级!important

为什么这段代码中 p.first 的效果没有体现出来?

求解

p{color:red!important;}

p.first{color:green;}

为什么,在这段代码中,p.first的效果没有显示出来?

提问者:慕前端0277412 2016-10-13 14:55

个回答

  • 月夜的忧伤
    2016-11-18 17:10:31

    在p标签中写<p class="first">...</p>

  • 慕仰5655071
    2016-10-13 15:00:13

    楼上正解


  • 慕圣7272570
    2016-10-13 14:59:28

    important 拥有最高权值