#多个盒子

<!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>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值