<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
div {
width: 400px;
height: 30px;
background: green;
display :table-cell;
}
span {
height: 30px;
line-height: 30px;
vertical-align:middle ;
}
</style>
</head>
<body>
<div>
<span style="font-size: 12px;">你好</span>
<span style="font-size: 14px;">你好</span>
<span style="font-size: 16px;">你好</span>
<span style="font-size: 18px;">你好</span>
<span style="font-size: 20px;">你好</span>
<span style="font-size: 22px;">你好</span>
<span style="font-size: 24px;">你好</span>
</div>
</body>
</html>
不同大小的字中部對齊
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.