zoukankan      html  css  js  c++  java
  • DIV制作小三角

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <style>
        .body{
            height: 100px;
             100px;
            background-color:blue;
            /*相对位置*/
            position: relative;
            /*无用代码*/
            margin: 100px 100px;
        }
        /**/
        .triangle1{
             0;
            height: 0;
            border: 10px solid red;
            border-top: none;
            border-right-color: transparent;
            border-left-color: transparent;
            /*绝对位置*/
            position: absolute;
            /*将小三角形向下移90个像素*/
            top: 90px;
            /*将小三角形向右移10个像素*/
            left: 10px;
        }
        .triangle2{
             0;
            height: 0;
            border: 10px solid red;
            border-left-color: transparent;
            border-bottom-color: transparent;
            border-top-color: transparent;
            position: absolute;
            top: 30px;
            left: -20px;
        }
        .triangle3{
             0;
            height: 0;
            border: 30px solid red;
            border-top: none;
            border-left-color: transparent;
            border-bottom-color: transparent;
            border-top-color: transparent;
            position: absolute;
            top: 0px;
            left: 40px;
        }
        .triangle4{
             0;
            height: 0;
            border: 10px solid red;
        }
        .triangle5{
             0;
            height: 0;
            border: 10px solid red;
            border-left-color: transparent;
            border-top-color: transparent;
            position: absolute;
            bottom: 0px;
            right: 0px;
        }
        .triangle6{
             0;
            height: 0;
            border: 10px solid red;
            border-left-color: transparent;
            border-right-color: transparent;
            border-top: none;
            position: absolute;
            left: 36px;
            bottom: 100px;
        }
        .triangle7{
             0;
            height: 0;
            border: 10px solid red;
            border-bottom-color: transparent;
            border-top-color: transparent;
            border-right-color: transparent;
            position: absolute;
            top: 30px;
            left: 100px;
        }
    </style>
    <body>
    <div class="body">
        <div class="triangle1">
    
        </div>
        <div class="triangle2">
    
        </div>
        <div class="triangle3">
    
        </div>
        <div class="triangle4">
    
        </div>
        <div class="triangle5">
    
        </div>
        <div class="triangle6">
    
        </div>
        <div class="triangle7">
    
        </div>
    </div>
    </body>
    </html>
    

      

  • 相关阅读:
    Java后台获取微信小程序用户信息、openid
    异步上传excel带进度条
    iOS 手机App消息推送功能(后台Java实现)
    Java花样排序
    Java 按页拆分pdf
    Java实现按行拆分pdf
    mac 上将.pem文件转为.pub文件
    strust2的核心和工作原理
    InputStream流转字节数组
    合并InputStream流
  • 原文地址:https://www.cnblogs.com/i-tao/p/12659057.html
Copyright © 2011-2022 走看看