俩栏自适应布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="index.css">
    <script src="index.js"></script>
</head>
<style type="text/css">
    *{
        margin: 0;
        padding: 0;
    }
    body {
        width: 100%;
        position: relative;
    }
    .hidden-box {
        height: 200px;
        width: 300px;
        overflow: hidden;
    }
    ul {
        height: 600px;
        list-style: none;
        animation:moveUl 12s infinite;
        transition: all 0.5s;
    }
    ul li{
        height: 200px;
    }
    li:first-child {
        background: red;
    }
    li:nth-child(2) {
        background: blue;
    }
    li:last-child {
        background: yellow;
    }
    @keyframes moveUl {
        0%,30%{
            transform: translateY(0);
        }
        33%,60%{
            transform: translateY(-200px);
        }
        66%,100%{
            transform: translateY(-400px);
        }
    }
    .flex-box {
        height: 200px;
        width: 100%;
        padding-left: 200px;
        margin-top: 20px;
        box-sizing: border-box;
    }
    .flex-child-box1 {
        height: 100%;
        width: 200px;
        background: blue;
        float: left;
        margin-left: -200px;
    }
    .flex-child-box2 {
        height: 100%;
        background: yellow;
        /*width: 100%;*/
    }
    .flex-child-box3 {
        width: 200px;
        background: brown;
        flex-grow: 0;
        flex-shrink: 0;
    }
    .flex2-box {
        height: 200px;
        width: 100%;
        display: flex;
        margin-top: 20px;
    }
    .flex2-child-box1 {
        width: 200px;
        height:100%;
        background: blue;
        flex-shrink: 0;
        flex-basis: 200px;
    }
    .flex2-child-box2 {
        width: 100%;
        background: yellow;
    }
    .flex3-box {
        height: 200px;
        width: 100%;
        margin-top: 20px;
    }
    .flex3-child-box1 {
        width: 200px;
        float: left;
        height: 100%;
        background: blue;
    }
    .flex3-child-box2 {
        /*width: 100%;*/
        height: 100%;
        background: yellow;
        overflow: hidden;
    }

</style>
<body>
<div class="flex-box">
    <div class="flex-child-box1"></div>
    <div class="flex-child-box2"></div>
</div>
<div class="flex2-box">
    <div class="flex2-child-box1"></div>
    <div class="flex2-child-box2"></div>
</div>
<div class="flex3-box">
    <div class="flex3-child-box1"></div>
    <div class="flex3-child-box2"></div>
</div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值