为了账号安全,请及时绑定邮箱和手机立即绑定

CSS布局——混合布局案例

标签:
Html/CSS
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title></title>
  <style type="text/css">
    /*此处写代码*/
    body {
        padding: 0;
        margin: 0;
    }

    .container {
        width: 80%;
        height:720px;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        margin: auto;
    }

    .banner {
        width: 100%;
        background: #add8e6;
        height: 480px;
    }

    .banner_l {
        float: left;
        width:50%;
        height:100%;
        background: url("http://climg.mukewang.com/58c0f808000129a303600215.jpg") center center no-repeat;
    }

    .banner_r {
        float: right;
        width: 50%;
        height: 100%;
    }

    .banner_r img {
        position: relative;
        top:50%;
        left: 50%;
        margin-top:-107px;
        margin-left:-180px;
    }

    .footer {
        width: 100%;
        height: 240px;
        background: #ffb6c1;
        display: table;
        text-align: center;
    }

    .footer_l, .footer_m, .footer_r{
        display: table-cell;
        vertical-align: middle;
        height: 240px;
    }

  </style>
</head>
<body>
  <!-- 此处写代码 -->
  <div class="container">
      <div class="banner">
            <div class="banner_l"></div>
            <div class="banner_r">
                <img class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="http://climg.mukewang.com/58c0f819000198a703600214.jpg" alt="">
            </div>
      </div>
      <div class="footer">
            <div class="footer_l">
                <img class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="http://climg.mukewang.com/58c0f81d0001fe4402000060.jpg" alt=""> 
            </div>
            <div class="footer_m">
                <img class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="http://climg.mukewang.com/58c0f8220001dfce02000060.jpg" alt=""> 
            </div>
            <div class="footer_r">
                <img class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="http://climg.mukewang.com/58c0f8780001c74602000060.jpg" alt=""> 
            </div>
      </div>
  </div>
</body>
</html>
点击查看更多内容
3人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消