0
pseudo selector
What pseudo selector is used to change something about an element which has been animated
1 Réponse
+ 9
Okay, you are asking about pseudo-selectors (or pseudo-classes) that can change an element after it's been animated.
In CSS, selectors include things like classes, IDs, elements, and also pseudo-classes and pseudo-elements. The term "pseudo-selector" isn't standard. The right terms are pseudo-classes (like :hover, :active) and pseudo-elements (like ::before, ::after). I explain it in pointing out that the term should be "pseudo-classes."
In standard CSS, there is no pseudo-class to directly target an element after an animation ends. Instead, you can use -
𝗮𝗻𝗶𝗺𝗮𝘁𝗶𝗼𝗻-𝗳𝗶𝗹𝗹-𝗺𝗼𝗱𝗲: 𝗳𝗼𝗿𝘄𝗮𝗿𝗱𝘀 to retain the element’s final animated state.
In JavaScript (via the 𝗮𝗻𝗶𝗺𝗮𝘁𝗶𝗼𝗻𝗲𝗻𝗱 event) to add/remove classes and apply styles post-animation.
If using JQuery, the :𝗮𝗻𝗶𝗺𝗮𝘁𝗲𝗱 pseudo-class exists, but it targets elements during an animation, not after it completes.
For animations, CSS relies on properties/events to manage post-animation styles.