演示代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="reset.css"/>
<style type="text/css">
.box{
width: 400px;height: 400px;background-color: aqua;
margin: 100px auto;overflow: hidden;
display: flex;/* 转成弹性盒子 */
/* justify-content: flex-end; */
/* justify-content: flex-start; */
justify-content: center;
/* align-items: flex-start; */
/* align-items: flex-end; */
align-items: center;
}
.wyzx{
width: 120px;height: 50px;line-height: 50px;
background-color: red;text-align: center;color: white;
}
</style>
</head>
<body>
<!-- ul.box>li.wyzx{我要自学$}*3 -->
<ul class="box">
<li class="wyzx">我要自学1</li>
</ul>
</body>
</html>