1、css样式(选择器)的优先级 1)计算权重确定 2)!important优先级最高,能覆盖它就再写个!important 3) 内联样式优先级也比较高 4)后写的优先级高
<style> .hahha { color: green !important; } </style> <body> <div class="hahha" style="color:red"> 你好 </div> </body>最终效果:绿色,!important比内联样式的优先级高
6、如何美化checkbox 1)label[for] 和 id 2) 隐藏原生input 3) :checked + label