Animate the CSS transition property within :after/:before pseudo-classes

后端 未结 4 1367
时光说笑
时光说笑 2020-12-24 13:24

Is it possible to animate CSS pseudo-classes?

Say I have:

#foo:after {
    content: \'\';
    width: 200px;
    height: 200px;
    background: red;
          


        
4条回答
  •  醉酒成梦
    2020-12-24 13:42

    Your fiddle does work for me in Firefox. And as far as I know, and if this article is up to date this is the only browser that can animate pseudo-elements.


    EDIT: As of 2016, the link to article is broken and the relevant WebKit bug was fixed 4 years ago. Read on to see other answers, this one is obsolete.

提交回复
热议问题