Margins Not Shrinking?

Hello guys, soo I'm working on a hotel site and I'm having trouble with making only the margins of my container shrink, when ever i drag the screen towards the mobile size only the content of the container shrinks and not the margins. My ideal scenario would be the margins shrinking until the content meets the side of the screen and then I use a media query to adjust the width of the container and so on... any help would be much appreciated 🙏
3 Replies
Pedretti Jr
Pedretti JrOP12mo ago
Thought about min-width but I thought there much be another way
MarkBoots
MarkBoots12mo ago
if you have a max-width on the container, you can have margin-inline: auto. then the margins will shrink first If that is not what you mean, make a small codepen example
clevermissfox
clevermissfox12mo ago
If you’re using clamp on your text, you can set margins in EMs so they’ll shrink along with the text and always be relative to that size
Want results from more Discord servers?
Add your server