Media Queries

Phreaddee

Super Moderator
Staff member
as many as are required for the design


generally speaking I'll start mobile first, have one around the 540px mark, another around the 800-900 mark and another at around 1300px.

again though it depends on the design.
 

Edge

Member
I think we're moving towards an approach whereby content decides the breakpoints. So basically create your mobile layout. Widen the viewing port until it looks shit then create a breakpoint. That's the idea and it sounds easy enough if you're working on your own but carrying a client through that process is another matter.
 

RDB

New Member
Thanks for that. I have started to use min and max width so that it covers mobile first, then tablets and desktop. I dont see the point in going any higher than 1200px for desktop. But you never know with these 4K monitors and TV's
 

Phreaddee

Super Moderator
Staff member
I start mobile first and only use min-width

I've found it a lot easier that way

by defining a min and a max on a media query, there is no cascading effect whatsoever, any selectors defined in that query will only effect that query.

for arguements sake, say you had a div on mobile first it was 100% width
then for your min-width:xxx max-width:xxx query it was 50%

beyond your max width you want it to be 50% still, however it will go back to the 100%, unless it's specified again,
however with only a min width it will stay at the 50%

if that makes any sense
 

Phreaddee

Super Moderator
Staff member
also when you work in a studio full of imacs which are all at a resolution of 2560px
or older ones at a resolution of 1920px
my laptop is 1280, my old laptop is 1366 and my 19" screens are 1440.

I can see the benefit of a higher query, and really 960px wide sites bore me these days.
if you can make it flex and work well on mobiles, tablets what not, why not go that extra step for the ever increasing amount of folk on larger screens?

they'll thank you for it.
 

RDB

New Member
I am using frameworks a lot more now, so it is just trial and error and finding the best solution really for what I need. Be interesting to see what a site looks like on a 4K monitor.
 

ronaldroe

Super Moderator
Staff member
Except that you do. It's called analytics. I'm betting the number is really close to zero.
 

chrishirst

Well-Known Member
Staff member
Except that you do. It's called analytics.

Exactly. Even if you do not use analytics for all your site stats, a simple Ajax function that writes screen.width to a database table or a flat file datastore can gather that information from your visitors.
 
Top