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
Войдите, чтобы добавить комментарий
Другие сообщения в этой группе

Brad Frost is running this new little podcast called Open Up. Folks write in with questions about the “other” side


In this post, Blackle Mori shows you a few of the hacks found while trying to push the limits of Cohost’s HTML support. Use these if you dare, lest you too get labelled a CSS criminal.
<



Tips and tricks on utilizing the CSS backdrop-filter
property to style user interfaces. You’ll learn how to layer backdrop filters among multiple elements, and integrate them with othe

Custom cursors with CSS are great, but we can take things to the next level with JavaScript. Using JavaScript, we can transition between cursor states, place dynamic text within the cursor, apply c