Do you guys prefer to use media query min-width or max-width?
I have noticed a lot popular CSS framework such as tailwind, Bootstraps etc. are using
min-width
for media query when doing some sort of CSS utility class name.
Are there any particular reason they are not using max-width
?7 Replies
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
As N306 said, if you're going mobile-first you want
min-width
since you're starting small and slowly enlarging the screen size. But if you're doing desktop-first you use max-width
as you start to take things away.
Mobile first is almost always preferable to desktop-first for several reasons:
ā¢ It's easier to add to the UI then to remove
ā¢ Most traffic on websites are mobile these days
ā¢ If it's responsive on mobile you don't have to do much at all to make it responsive on desktop
ā¢ If something breaks on the desktop media queries the mobile site can still be used on larger screen sizes no problem
So it's almost always best to do mobile-first and use min-width
. And you have max-width
in your pocket when you absolutely need it.Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Yes, always mobile first. Because otherwise that one person who tries to use it on their tablet or phone will be the CEO of the company. And they will be pissed it doesn't work as they expect it to
Always always always cater to the dumbest and least tech-savvy user
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Thanks for the answers guys! This was really helpful! š
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View