- Em 基于父元素的字体大小
: :: 单冒号 双冒号区别 低版本浏览器支持: 高版本都支持默认将:变为::, h5规范为::
/*
参数1:x轴的偏移
参数2:y轴的偏移
参数3:阴影的模糊的
参数4:阴影的延伸
参数5:阴影的颜色
参数6:内阴影
*/
box-shadow: 0 -2px 2px #d8d8d8 inset;
- 特殊样式

.product_box.active::before{
content: "\e915";
position: absolute;
left: 0;
top: -7px;
font-family: wjs;
font-size: 33px;
}
.product_box .pro_right::before,
.product_box .pro_right::after{
content: "";
position: absolute;
width: 12px;
height: 12px;
border-radius: 6px;
background: #f5f5f5;
left: -6px;
}
.product_box .pro_right::before{
top: -6px;
/*
参数1:x轴的偏移
参数2:y轴的偏移
参数3:阴影的模糊的
参数4:阴影的延伸
参数5:阴影的颜色
参数6:内阴影
*/
box-shadow: 0 -2px 2px #d8d8d8 inset;
}
.product_box .pro_right::after{
bottom: -6px;
box-shadow: 0 2px 2px #d8d8d8 inset;
}
- 选择器
找到P元素,通过P找到父元素,通过父元素找子元素当中类型为P的,然再去找第几个。
p:first-of-type
p:last-of-type
p:nth-of-type(n)
p:nth-last-of-type(n)
如果使用的是child;
p:first-child
找到P元素,通过P找到父元素,通过父元素找所有的子元素,找第一个元素,匹配判断类型(如果不是无效选择器)
-
加入元素不影响其他区块?
image.png
.product_box .pro_right .tips{
position: absolute;
left: 0;
top: 10px;
width: 100%;
}
.product_box .pro_right .tips span{
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
border-width: 1px;
border-style: solid;
display: inline-block;
}
.product_box .pro_right .tips .red{
color: red;
border-color: red;
}
.product_box .pro_right .tips .green{
color: green;
border-color: green;
}
.product_box .pro_right p:first-of-type{
margin-top: 25px;
color: #e92322;
}
.product_box.active .pro_right p:first-of-type{
color: #fff;
}
.product_box .pro_right p:first-of-type b{
font-size: 48px;
}
.product_box .pro_right p:first-of-type sub{
bottom: 0;
font-size: 12px;
}
.product_box .pro_right p:last-child{}
- ul默认会有编剧 padding 0
网友评论