<!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>
不同大小的字中部对齐
最新推荐文章于 2022-08-01 12:51:31 发布