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

  • 相关阅读:
    Linux and the Unix Philosophy(6)
    在docker环境下部署kafka集群
    Docker学习笔记1-docker介绍及安装
    nginx安装
    centos7下NFS配置
    搭建kafka集群
    nexus开机启动
    java跨库事务Atomikos
    mongodb数据库还原
    Linux下运行jar
  • 原文地址:https://www.cnblogs.com/yuwen1995/p/15209267.html
Copyright © 2011-2022 走看看