<!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>弹性布局</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
ul,li{
list-style: none;
}
ul{
margin-top: px;
height: 500px;
width: 1488px;
border: 1px solid red;
display: flex; /* 把它设置成弹性盒子,它会自动排成一行 */
/* justify-content水平方向 */
/* 居中 */
/* justify-content: center; */
/* 分散对齐 */
justify-content: space-around;
/* 两端对齐 */
/* justify-content: space-between; */
/* 右对齐 */
/* justify-content: flex-end; */
/* 左对齐(默认) */
/* justify-content: flex-start; */
/* align-items垂直方向 */
/* 居中 */
align-items: center;
/* 底部对齐 */
/* align-items: flex-end; */
/* 顶部对齐(默认) */
/* align-items: flex-start; */
}
.box1{
height: 100px;
width: 1488px;
border: 1px solid red;
text-align: center;
}
ul li{
height: 400px;
width: 260px;
border: 1px solid #ffffff;
text-align: center;
color: black;
background-color:#eeeeee;
text-decoration: none;
}
a{
color: black;
text-decoration: none;
}
.smallbox {
margin-left: 14px;
margin-top: 10px;
background-color: #e8e1de;
/* css3效果过渡 */
transition: all .2s linear;
}
.smallbox:hover {
/* 盒子阴影 */
box-shadow: 4px 20px 40px 5px rgba(0, 0, 0, .1);
/* 盒子向上移动效果,改变上外边距 */
margin-top: 8px;}
.c{
font-size: 12px;
font-weight: 450;
text-align: center;
text-align: center;
}
.b{
color: #ff6700;
text-align: center;
font-size: 14px;
}
</style>
</head>
<body>
<div class="box1">
<div class="smallbox">
4
</div>
</div>
<ul>
<li class="smallbox">
</li>
<li class="smallbox">
</li>
<li class="smallbox">
</li>
<li class="smallbox">
</li>
<li class="smallbox">
</li>
</ul>
</body>
</html>
#多个盒子
最新推荐文章于 2024-08-30 16:48:59 发布