以chrome浏览器作为调试工具,打开如下页面:
<!DOCTYPE>
<html lang="zh-CN">
<head>
<title>网页</title>
<meta http-equiv="Content-Type" content=" charset=utf-8" />
<style>
div{
width: 150px;
background: #456789;
margin: 200px;
}
span{
display: inline-block;
}
.span1{
width: 115px;
height: 115px;
background: #000fff;
text-align: center;
line-height: 115px;
}
.span2{
width: 25px;
height: 25px;
background: #fff000;
margin-left: 0px;
margin-top: 0px;
padding-top:0px;
text-align: center;
line-height: 25px;
}
</style>
</head>
<body>
<div>
<span class="span1">11</span><span class="span2">22</span>
</div>
</body>
</html>
选中margin-top行,按键盘的上下方向键即可调整大小。同样选中padding-top行,如前操作。鼠标放在右侧盒子图上可以发现padding和margin值会影响行高。