zoukankan      html  css  js  c++  java
  • 边框0.5px的实现方法

    原理: css3 的缩放   ---->    transform: scale()

      完整代码如下:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div {
                height: 200px;
                 200px;
                margin: 50px auto;
                position: relative;
                /*background: #f4f4f4;*/
            }
            .box::after {
                content: '';
                position: absolute;
                left: 0;
                top: 0;
                 200%;
                height:200%;
                border:1px solid #000000;
                -webkit-transform-origin: 0 0;
                transform-origin: 0 0;
                -webkit-transform: scale(.5, .5);
                transform: scale(.5, .5);
                -webkit-transform: scale(.5, .5);
                -ms-transform: scale(.5, .5);
                z-index: 1;
            }
            .bd-t::after {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                 100%;
                border-top: 1px solid #000;
                transform: scaleY(.5);
                -webkit-transform: scaleY(.5);
                -ms-transform: scaleY(.5);
            }
            .bd-l::after {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                border-left: 1px solid #000;
                transform: scaleX(.5);
                -webkit-transform: scaleX(.5);
                -ms-transform: scaleX(.5);
            }
            .box1 {
                height: 200px;
                 200px;
                margin: 50px auto;
                position: relative;
                border: 1px solid #000;
                /*background: #09f;*/
            }
        </style>
    </head>
    <body>
        <div class="box">
            四条边框0.5px
        </div>
        <div class="bd-t">
            顶部边框0.5px
        </div>
        <div class="bd-l">
            左边框0.5px
        </div>
        <div class="box1">参考相</div>
    
    </body>
    </html>
  • 相关阅读:
    C语言程序设计II—第六周教学
    第一次结对编程情况反馈
    C语言程序设计II—第五周教学
    C语言程序设计II—第四周教学
    放缩
    切线垂直
    指数为对数时取对数
    整体运算
    数列求通项+离散数列单调性判断
    整体运算+求零点
  • 原文地址:https://www.cnblogs.com/wangyihong/p/7072651.html
Copyright © 2011-2022 走看看