July 2, 2019 02:19 pm GMT
Original Link: https://css-tricks.com/restricting-a-pseudo-element-to-its-parents-border-box/
Restricting a (pseudo) element to its parents border-box
Have you ever wanted to ensure that nothing of a (pseudo) element gets displayed outside its parent's border-box
? In case you're having trouble picturing what that looks like, let's say we wanted to get the following result with minimal markup and avoiding brittle CSS.
The desired result.
This means we cannot add any elements just for visual purposes and we cannot create shapes out of multiple pieces, whether that's directly or via masks. We also want to avoid long, … Read article
The post Restricting a (pseudo) element to its parent’s border-box appeared first on CSS-Tricks.
Original Link: https://css-tricks.com/restricting-a-pseudo-element-to-its-parents-border-box/
Share this article:
Tweet
View Full Article