Only detect click event on pseudo-element

前端 未结 10 1850
长情又很酷
长情又很酷 2020-11-22 08:00

My code is:

p {
    position: relative;
    background-color: blue;
}

p:before {
    content: \'\';
    position: absolute;
    left:100%;
    width: 10px;
         


        
10条回答
  •  情歌与酒
    2020-11-22 08:50

    No,but you can do like this

    In html file add this section

    In css you can do like this

    p div.arrow {
        content: '';
        position: absolute;
        left:100%;
        width: 10px;
        height: 100%;
        background-color: red;
    } 
    

    Hope it will help you

提交回复
热议问题