I want to be able to detect if the current user is using a low-res ( < 320px) device and load a different stylesheet for that user. Is there a way to do so?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You can find many articles on the web explaining how you can build good website designs for smartphones.
To answer your case, you can find several ways to handle it:
Media Queries
Since CSS3, you can use the
max-widthor thedevice-width.That would give something like:
JavaScript
You can use javascript to check the browser width.
Here is an example using jquery:
Going further
Here are a few interesting and useful links: