最赞回答 / ChinaSu
border是HTML属性,只能设置宽度值,例如border="1";而1px solid red为样式属性值,需要放到style属性值里,例如style="border:1px solid red"
2018-05-25
最赞回答 / 宝慕林9459682
具有继承:visibility \ cursor \ letter-spacing \ word-spacing \ white-space \ line-height \ color \ font \ font-family \ font-size \ font-style \ font-variant \ font-weight \ text-decoration \text-transform \ direction \ text-indent \ text-align不可继承:display \ ...
2018-05-25
已采纳回答 / _你想不想飞_0
这个不是权值的问题了,是方法的优先级不一样。.first是属于嵌入式,span是内联式的。如果使用同一种方法,就可以比较权值了。方法的优先级最好的理解方法就是,离你越近的就越优先,毕竟我们是懒人,能走一步绝对不走两步。可参考 7-4
2018-05-24
最赞回答 / ColdBrewKoffee
他的教程里的第一行有提到 比较权值的时候,其实是对同一个元素来看的。<p> 和 .first 是同一个HTML标签元素,而 <span> 是子元素(不同于<p>元素),所以设置 span{color:pink;} 和其他的设置之间没有权值比较。检验方法:将 <span> 变为 <span class="first"> 试试看。
2018-05-24