Does :before not work on img elements?

后端 未结 12 2438
眼角桃花
眼角桃花 2020-11-22 01:46

I\'m trying to use the :before selector to place an image over another image, but I\'m finding that it simply doesn\'t work to place an image before an im

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 02:32

    Due to the nature of being a replaced element, document styling doesn’t affected it.

    To reference it anyway, provides an ideal, native wrapper that can have pseudo-elements attached to it, like so:

    img:after, picture:after{
        content:"\1F63B";
        font-size:larger;
        margin:-1em;
    }
    
    
    
        
    

提交回复
热议问题