Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help with Mobile CSS Re: Help with Mobile CSS

#130293
CrocoDillon
Participant

You’re already doing exactly that with those media queries, ‘if the screen width is less than 480px apply this styling’ and ‘if the screen is exactly 768px apply that style’ (the comments might say iPhone 3G but it works for [a lot more mobile devices](http://caniuse.com/#feat=css-mediaqueries) than just that one).

However you’re better off with media queries like:

@media screen and (max-width: 480px)

Which will respond to actual window width instead of screen width, and put the largest one first (so `max-width: 768px` first and then `max-width: 480px`, else you’ll have styles for 481px to 768px overwriting styles for <= 480px).