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 8258055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:24:22+00:00 2026-06-08T02:24:22+00:00

I am developing a small mobile page which supposed to be visible only for

  • 0

I am developing a small mobile page which supposed to be visible only for mobile devices.
But it should fit all Android & iPhone devices and their resolutions.

The template includes table and couple of images which should shrink in percentage in relation to the ratio of resolution change

what i basically need is a tip for smart CSS code which will consider the resolution and will pick from couple of different stylesheets i will create.

  • 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-08T02:24:24+00:00Added an answer on June 8, 2026 at 2:24 am

    You can detect exact device using JS and generate stylesheet link for it.

    //Detect mobile devices
    var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())),
    
    //Detect only iPhone
    iphone = (/iphone/i.test(navigator.userAgent.toLowerCase()));
    
    //Apply stylesheet for mobile devices
    if(mobile){
       var cssLink = document.createElement("link");
       cssLink.setAttribute("type", "text/css");
       cssLink.setAttribute("rel", "stylesheet");
       cssLink.setAttribute("href", "css/mobile.css");
       document.head.appendChild(cssLink);
    }
    
    //Apply stylesheet for iPhone only
    if(iphone){
       var cssLink = document.createElement("link");
       cssLink.setAttribute("type", "text/css");
       cssLink.setAttribute("rel", "stylesheet");
       cssLink.setAttribute("href", "css/mobile.css");
       document.head.appendChild(cssLink);
    }
    

    Or detect all mobile devices using Media Query max-device-width:

    @media only screen and (max-device-width: 480px) {
         /* CSS for mobile */
    }
    

    Notice that I set max-device-width to 480px. This is because of mobile devices screen measurements, it’s in reference pixels which is bigger than actual device pixel.
    For example both iPhone 3 and 4 has device width 320px in both landscape and portrait modes. Some Android devices returns device width 480px.

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

Sidebar

Related Questions

I'm developing an app for android mobile devices. I'm using the AVD emulator and
I am developing a small android application in that i want find the mobile
I' developing a small android maze game and I'm experiencing a strange effect which
I'm developing a small android mobile application with a tab based interface. One tab
I am developing a small app in which I want a background service to
I am developing a small app while learning Android. The app is basically making
I'm currently developing a small OpenGL game for the Android platform and I wonder
I am developing one small app in which i have multiple NSURLConnection.I have created
I am developing a small android application. When the user hasn't signed up, he
I am developing an small application in a android. Before this i had done

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.