Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:53:48+00:00 2026-06-17T07:53:48+00:00

I wrote some CSS code to make an HTML page fit better in mobile

  • 0

I wrote some CSS code to make an HTML page fit better in mobile browsers. To be sure that my CSS apply only on mobiles, I use to following media query :

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

As an iPhone developer, I tested on this device and it works really well. But I want my CSS to be use on all kind of devices (Android, Windows Phone, etc).

What would be a good resolution that would fit most of smartphone of these days? Or do I need a more complex media query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:53:49+00:00Added an answer on June 17, 2026 at 7:53 am

    Updated: Mars 2016

    Projects are all different, so it’s hard to set a global rule that will fit them all. If you’re looking for one, here’s an example that someone smarter than me came up with and that I’ve used before:

    xsmall:     (max-width: 479px),
    small:      (max-width: 599px),
    medium:     (max-width: 767px),
    large:      (max-width: 1024px),
    largeOnly:  (min-width: 768px) and (max-width: 1024px),
    xxl:        (min-width: 1200px),
    tall:       (min-height: 780px),
    

    Note the lack of references to devices, screen sizes or orientation on their names. The size of a ‘tablet portrait’ shouldn’t really matter to us as we should try to make things responsive and look good on any screen size, not simply adaptive to a few screen sizes.

    Yes, it’s important to know the most common screen sizes and avoid crazy media queries, but in the end, your design may start to beg for adjustments at 530px instead of 480px or something like that. So why not?

    Now, on my personal preferences: I keep media queries in mind all the time, but at first I tend to ignore device sizes almost completely. I also prefer the desktop-first approach cause I find it easier to adjust layouts to smaller sizes (ie.: removing not so important things from the page, reducing sizes, etc.).

    Original Answer

    Some people tend to ignore device sizes completely. They say you should check where your layout starts to break and create media queries only when necessary. Others will check for different device sizes, as you’re doing now. But then you’ll have a media query for 320px, another for 480px, and so on… You may go crazy with that, and maybe it’s not even necessary depending on your layout!

    So, for now I’m trying to do both. I tend to ignore device sizes at first and will create some media queries only when necessary (when layout breaks), until it looks good for sizes like 960px and bigger, and also for smaller screen sizes, like 320px (the smallest device size I care about).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a HTML/CSS snippet that is included in some 3-rd party website. But
I am testing some weird-looking CSS code that I wrote (I'm using a mix
I wrote a simple plugin which sets some css code using wp_options. It all
I wrote some code in VHDL that is expected to look at a rotory
I wrote some code that activity starts a service to get some text from
I wrote some naive code(in the sense that it's synchronous calls) for a tableview
I would like to write up some css/html for container boxes that I can
I wrote up a post in WordPress that included some code samples. I used
I wrote some code to read a file in my Java Servlet class. (I'm
I wrote some code which monitors the output of Stopwatch using a tight loop.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.