Vianney
KPCKevin Powell - Community
•Created by Vianney on 11/10/2023 in #front-end
clip-path Why does it work? 🤔
I think I get it. Because of the clip-path, I have to think about what's inside and what's outside each box. All children outside will be hidden by the clip-path and all children inside will be visible. As both p's are identically fixed, they exit the flow and overlap. Scrolling the two boxes obviously doesn't move the two fixed p's, but rather the visible and hidden areas of each box.
5 replies
KPCKevin Powell - Community
•Created by Vianney on 11/10/2023 in #front-end
clip-path Why does it work? 🤔
Thank you @MarkBoots
I have given a different background color to the two p elements.
I understand that with the fixed position, the two p element are on top of the other elements.
I'm very sorry but I still do not understand why as the gray background rises, it hides the gray text (inside .bx-1) and not the white text (inside .bx-2).
(Thanks for the tip inset(0) )
5 replies