Make the right side of a div as an arrow

后端 未结 7 724
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 01:23

I have a simple div on a page:

Some Text

Is it possible, with CSS, to make it finish as an arrow. Something like:

7条回答
  •  生来不讨喜
    2020-12-03 01:44

    Check This

    DEMO

    HTML

    Some Text

    CSS

    .text {
        background-color:#ff0000;
        color:#fff;
        display:inline-block;
        padding-left:4px;
    }
    .arrow {
        border-style: dashed;
        border-color: transparent;
        border-width: 0.20em;
        display: -moz-inline-box;
        display: inline-block;    /* Use font-size to control the size of the arrow. */
        font-size: 100px;
        height: 0;
        line-height: 0;
        position: relative;
        vertical-align: middle;
        width: 0;
        background-color:#fff;   /* change background color acc to bg color */ 
        border-left-width: 0.2em;
        border-left-style: solid;
        border-left-color: #ff0000;
        left:0.25em;
    }
    

提交回复
热议问题