I like Andy’s idea here: .wrapper { width: clamp(16rem, 90vw, 70rem); margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; } Normally I’d just set a max-width there, but as Andy says:
This becomes a slight issue in mid-sized viewports, such
…
The post Use CSS Clamp to create a more flexible wrapper utility appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.
https://piccalil.li/quick-tip/use-css-clamp-to-create-a-more-flexible-wrapper-utility
Melden Sie sich an, um einen Kommentar hinzuzufügen
Andere Beiträge in dieser Gruppe

Clever, clever that Andy Bell. He shares a technique for displaying image alt
text when the image fails to load. Well, more precisely, it's a technique to apply styles to the alt

Shape master Temani Afif has what might be the largest collection of CSS shapes on the planet with all the tools to generate them on the fly.


Some weekend reading on the heels of Global Accessibility Awareness Day (GAADM), which took place yesterday. The Email Markup Con

Hey, isn't there a fairly new CSS feature that works with scroll regions? Oh yes, that's Scroll-Driven Animations. Shouldn't that mean we can trigger an animation while scrolling through the items


I know, I know: there are a ton of content management system options available, and while I've tested several, none have really been the one, y'know? Weird pricing models, difficult customization,