zoukankan      html  css  js  c++  java
  • css 画箭头

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <style>
            *
            {
                margin: 0px;
                padding: 0px;
            }
    
            #show
            {
                margin: 10px auto;
                position: absolute;
                top: 50px;
                left: 50px;
                text-align: center;
            }
    
            #some
            {
                 200px;
                margin-left: 100px;
                text-align: center;
                position: absolute;
                background-color: rgba(255, 0, 0,0.6);
                border-radius: 5px;
            }
    
            #info
            {
                 400px;
                height: 300px;
                position: absolute;
            }
    
            #outarrow
            {
                border-color: transparent transparent #efefef;
                border-style: solid;
                border- 16px;
                height: 0;
                 0;
                position: absolute;
                top: 0px;
                left: 184px;
            }
    
            #innerarrow
            {
                border-color: transparent transparent white;
                border-style: solid;
                border- 16px;
                height: 0;
                 0;
                position: absolute;
                top: 0px;
                left: 184px;
                margin-top: 6px;
            }
    
            #content
            {
                border: 4px solid;
                border-radius: 4px;
                border-color: #efefef;
                 400px;
                margin: 32px auto 0px;
                -moz-box-sizing: border-box;
                -webkit-box-sizing: border-box;
                box-sizing: border-box;
            }
    
                #content p
                {
                    text-align: left;
                    text-indent: 20px;
                }
        </style>
    
    </head>
    <body>
        <div id="show">
            <div id="some">下面就是箭头效果</div>
            <div id="info">
                <div id="outarrow"></div>
                <div id="innerarrow"></div>
                <div id="content">
                    <h1>使用边界产生箭头</h1>
                    <p>要点1:设置盒子的宽高均为0,只设置边界宽度</p>
                    <p>要点2:可以通过border-style改变效果</p>
                </div>
            </div>
        </div>
    </body>
    </html>

    显示效果:

  • 相关阅读:
    PAT顶级 1024 Currency Exchange Centers (35分)(最小生成树)
    Codeforces 1282B2 K for the Price of One (Hard Version)
    1023 Have Fun with Numbers (20)
    1005 Spell It Right (20)
    1092 To Buy or Not to Buy (20)
    1118 Birds in Forest (25)
    1130 Infix Expression (25)
    1085 Perfect Sequence (25)
    1109 Group Photo (25)
    1073 Scientific Notation (20)
  • 原文地址:https://www.cnblogs.com/chenqingbin/p/10984628.html
Copyright © 2011-2022 走看看