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>Document</title>
        <style>
            html,body {
                position: relative;
                 100%;
                height:100%;
            }
            .triangle {
                 0px;
                height:0px;
                border-bottom: 200px solid #00a3af;
                border-left: 200px solid transparent;
                border-right: 200px solid transparent;
            }
            .hr {
                margin-top: 500px;
                border: 1px solid #00a3af;
                transform: scaleY(0.5);
            }
            .clign {
                position: absolute;
                left: 0;
                right:0;
                top: 0;
                bottom:0;
                 200px;
                height: 200px;
                background-color: bisque;
                margin: auto;
            }
        </style>
    </head>
    <body>
        <div class='triangle'></div>
    
        <div class="hr"></div>
    
        <div class='clign'></div>
    </body>
    </html>

     显示效果如下所示:

  • 相关阅读:
    vijos1776:关押罪犯
    vijos1774:机器翻译
    vijos1775:乌龟棋
    vijos1792:摆花
    vijos1100:加分二叉树
    vijos1706:舞会
    单调栈
    bzoj1677:求和
    bzoj1340: [Baltic2007]Escape逃跑问题
    bzoj4716: 假摔
  • 原文地址:https://www.cnblogs.com/lxz123/p/15262460.html
Copyright © 2011-2022 走看看