Make an arrow using CSS

后端 未结 2 1331
梦毁少年i
梦毁少年i 2021-01-20 02:39

I am trying to make something like an horizontal label: But there is a condition, should be an unique div. Probably with canvas is possible, however i have

相关标签:
2条回答
  • 2021-01-20 02:54

    http://jonrohan.me/guide/css/creating-triangles-in-css/

    might be of help to you, looks like what youre trying to do

    0 讨论(0)
  • 2021-01-20 02:56

    You can accomplish this with some border hacks, positioning, and the :before psudo-element.

    http://jsfiddle.net/VQcyD/

    #msg {
        width:100px;
        height:40px;
        background:red;
        margin-left:40px;
        position:relative;
    
    }
    #msg:before {
        content:"";
        position:absolute;
        border-bottom: 20px solid transparent;
        border-right: 20px solid red;
        border-top: 20px solid transparent;
        height: 0px;
        width: 0px;
        margin-left:-20px;
    }
    
    0 讨论(0)
提交回复
热议问题