Make the right side of a div as an arrow

后端 未结 7 723
隐瞒了意图╮
隐瞒了意图╮ 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:46

    Try this code

      .arrow_box {
            position: relative;
            background: #88b7d5;
            border: 4px solid #c2e1f5;
        }
        .arrow_box:after, .arrow_box:before {
            left: 100%;
            top: 50%;
            border: solid transparent;
            content: " ";
            height: 0;
            width: 0;
            position: absolute;
            pointer-events: none;
        }
    
        .arrow_box:after {
            border-color: rgba(136, 183, 213, 0);
            border-left-color: #88b7d5;
            border-width: 89px;
            margin-top: -89px;
        }
        .arrow_box:before {
            border-color: rgba(194, 225, 245, 0);
            border-left-color: #c2e1f5;
            border-width: 95px;
            margin-top: -95px;
        }
    

提交回复
热议问题