<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
margin: 0;
}
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 6px;
}
.item {
height: 100px;
padding: 6px;
width: 33.3%;
box-sizing: border-box;
}
.content {
width: 100%;
height: 100%;
font-size: 30px;
line-height: 1;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="item">
<div class="content">
<span>我爱丽丽</span>
</div>
</div>
<div class="item">
<div class="content"></div>
</div>
<div class="item">
<div class="content"></div>
</div>
<div class="item">
<div class="content"></div>
</div>
</div>
</body>
</html>
老师 ,为啥这个line-height设置为1就不能居中对齐啊 非得设置为多少px才可以,百分比也不行