css的优先级 常用的选择器排序 !important>行内样式>#id>.class>标签(div,p…) 权重值详解 !important !权重值无穷大,但也可以计算. 例如 div{ color:red !important; } body div{ color:red !important; /* 该权重值就大于上方*/ /* !important使用后不利于后期的调试,尽量用子代,后代叠加权重值 */