DIV被撑大,没有设定margin,子元素有margin,本来设定的40PX变成了43,标题栏的高度是40PX却是灰色的,标题栏是一个DIV然后里面有歌曲名,歌手名是一个span有margin:5,下角标是一个span`#musicDetails .detail_tile {
width: 100%;
height: 40px;
background: rgba(41, 171, 266, 0.6);
font-size: 20px;
line-height: 40px;
text-align: center;
color: white;
}
#musicDetails .detail_tile span {
font-size: 12px;
margin: 5px;
}
#musicDetails .detail_tile .details_tip {
width: 19px;
height: 10px;
background: url(img/details_arrow.png) no-repeat;
background-size: cover;
position: absolute;
right: 20px;
top: 15px;
}
`
details_name这个class我是没有设定样式表的,设置了父容器的高度40px,但是现在实际情况是父容器还是40,details_name这个标题栏的div莫名其妙变成了43.2px而且是灰色的
找到答案了https://segmentfault.com/a/11...