如题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<style>
*{
font-size:0;
margin:0;
padding:0;
}
.container{
margin-top:20px;
background-color: orange;
font-size:20px !important;
line-height: 1;
}
</style>
</head>
<body>
<div class="container">
<span style="background-color: #fff;">xxxx</span>
</div>
</body>
</html>
不能显示span里的内容
如上各位兄台所说,span的字体是可以继承父样式的字体的,可是呢,因为涉及到css优先级问题,通配符优先级大于继承而来样式的优先级,所以span获得的字体样式来自于通配符。有图有真相: