Combine :after with :hover

前端 未结 3 1713
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 16:54

I want to combine :after with :hover in CSS (or any other pseudo selector). I basically have a list and the item with the selected cl

3条回答
  •  [愿得一人]
    2020-11-29 17:09

     #alertlist li:hover:after,#alertlist li.selected:after
    {
        position:absolute;
        top: 0;
        right:-10px;
        bottom:0;
    
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 10px solid #303030;
        content: "";
    }​
    

    jsFiddle Link

提交回复
热议问题