zoukankan      html  css  js  c++  java
  • css画小三角

    要点:

    • div的宽度设为0
    • border-color 的transparent属性
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
        <style>
            .tri{
                margin: 60px;
                border: 10px solid ; 
                /* 0;  要有,不设置宽度的话,默认div的100%宽度,三角会跑到最右边*/
                /*border-color: red transparent transparent transparent;*/ 
                border-color:  transparent red transparent transparent;
                /*border-color:  transparent transparent red transparent;*/
                /*border-color:  transparent transparent transparent red;*/
                /*outline: 1px solid green;*/
            }
        </style>
    </head>
    <body>
        <div class="tri">
            
        </div>
    </body>
    </html>
  • 相关阅读:
    某题2
    某题1
    某题
    DAY 7
    DAY 4
    数据结构(六)图
    【转载】大数据面试知识图谱
    数据结构(四)二叉树
    Scala(一)基础
    Java虚拟机(一)
  • 原文地址:https://www.cnblogs.com/nostic/p/5899373.html
Copyright © 2011-2022 走看看