devdrivenai
devdrivenai
KPCKevin Powell - Community
Created by devdrivenai on 12/4/2024 in #front-end
Is `min-width` necessary or best practice for containers?
Hi community, I have this situation where I have a page that has a single card with content inside. As I learned in CRL course, I set its width with width: min(90%, 24rem);, which in all honesty I like how it works. However, someone elsewhere recommended me to set a min-width because as they showed me using responsive mode of the browser in like less than 200px viewport width is too squishy and gets all broken (which yeah it's true of course). My thinking though is that there are no screens of that side. I assume what they have in mind is at that point with min-width making the card overflow, so they either scroll inline or just plainly use landscape mode. For me, though, there is no point on spending time on preparing for situations that don't exist... there are no screens of like 200 px wide, I think (and if there are, how do you even read?). But what they argued to this is that if you kind of scale the screen (I suppose with zoom out or something like that) then in that case it would matter. I was left a little puzzled. In your experience, is that right to think about those extra tiny sizes? If so, do you set min-width like that to everything? And if so, is that kind of compatible with the min(%,rem) we learned in the course? Thanks in advance for your insight!
5 replies