<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.spa1{
width: 5px;
height: 10px;
background-color: red;
/* display: table-cell; */
/* vertical-align: middle; */
}
.spa2{
width: 150px;
height: 50px;
line-height: 50px;
display: table-cell;
vertical-align: middle;
}
.div2{
height: 50px;
display: table;
}
</style>
</head>
<body>
<div class="div2">
<div class="spa1"></div>
<span class="spa2">概述详情</span>
</div>
<script></script>
</body>
</html>
table & table-cell 居中
最新推荐文章于 2023-09-25 15:24:06 发布