突然写起来有点懵,查了些资料感觉都不太合适,自己想了个办法;

html+css九宫格宽度百分比1px边线的实现

代码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue Model</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        li {
            list-style: none;
        }

        .parent {
            border-left: 1px solid #0000ff;
            border-top: 1px solid #0000ff;
            overflow: auto;
        }

        .child {
            display: block;
            
            border-bottom: 1px solid #0000ff;
            border-right: 1px solid #0000ff;
            text-align: center;
            padding: 30px 0;
            width: 25%;
            float: left;
            box-sizing: border-box;
        }
    </style>
</head>

<body>
    <div id="app1">
        {{msg}}
        <ul class="parent">
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
            <li class="child">内容</li>
        </ul>
    </div>
</body>

</html>

 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2022-01-14
  • 2021-12-23
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案