Learn CSS transformations by building a penguin - step 39

<div class="penguin">
        <div class="penguin-head"></div>
        <div class="penguin-body"></div>
</div>

.penguin * { position: absolute;...}

.penguin-body::before {position: absolute...}

I’m confused on step 39, why would we need to add position: absolute to the ::before pseudo selector of penguin if the * selector already sets it? I tried removing the position: absolute rule from the pseudo element in step 40, and it dissapeared from the dom…can someone explain this?

I also asked chatgpt, and it answered that the * selector also applies to all descendant pseudo selectors.

It seems chatgpt changed its response, the * selector doesn’t affect pseudo elements

1 Like