zoukankan      html  css  js  c++  java
  • css 井布局

    <!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>
            .box {
                 300px;
                margin: 100px;
                overflow: hidden;
            }

            .item {
                float: left;
                 100px;
                height: 100px;
                border: 1px solid #000;
                border-right: 0;
                border-bottom: 0;
                margin-left: -1px;
                margin-top: -1px;
            }
        </style>
    </head>
    <body>
        <div class="box">
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
            <div class="item"></div>
        </div>
    </body>
    </html>

      

    1、父元素设置宽度 每行控制几个

    2、子元素boder,且border-right/border-bottom设为0。通过margin负距隐藏border-top/border-lelft

  • 相关阅读:
    Git版本控制+配置中心(Spring Cloud Config)(八)
    NodeJS+Sidecar异构系统+Zuul(七)
    API网关Zuul(六)
    Hystrix断路器(五)
    Feign配合Ribbon和Eureka来提供负载均衡的HTTP客户端(四)
    负载均衡Ribbon(三)
    Eureka注册中心(二)
    SpringCloud介绍(一)
    Swift基础小结_2
    谓词(搜索)
  • 原文地址:https://www.cnblogs.com/yuwen1995/p/15209267.html
Copyright © 2011-2022 走看看