Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 2, 2019 02:19 pm GMT

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:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks