DEV Community 👩‍💻👨‍💻

Discussion on: How to create pure CSS illustrations and animate them - Part 2

agathacco profile image
Agathe Cocco Author

Glad you had fun Tolu! I tend to use pseudo selectors whenever an element is made of several parts. If an element needs at least one child to recreate the different parts, then its a good candidate. The flash for example is made of two rectangles, so we can use the actual .flash div to create one rectangle, and use one of its pseudo selectors to create the second one. However, I wouldn't use a pseudo selector of .flash to create an unrelated element, say, the blinker. Just like you would have the .blinker element be a child of flash. This doesn't make a lot of sense.

But don't worry to much about pseudo selectors if you are not comfortable with them just yet. You can use plain html divs too!