id 优先级大于 class
行间 style 优先级大于id
class 和属性是并行的
!important > 行间样式 >id >class|属性 >标签选择器 >t通配符
!important Infinity 无穷大
行间样式 1000
id 100
class|属性|伪类 10
标签|伪元素 1
通配符 0
权重大小不一样
/*
父子选择器/派生选择器
*/ div 下面的span
div span{
color:red;
}
/*
并列选择器
*/
div.demo{
}
权重计算方法
#div p{}
id: 100 + 标签 1 101
属性:10 属性10 20
.classa .classb
/*分组选择器*、
em,
strong,
span{
}