Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to differentiate between 1000px screen size of desktops and tablets without browser sniffing?

I use alot of transition, hover, and shadow effects on the desktop version of my site. I need to get rid of them for my tablet version which I thought I could do with media queries but my issue is when i use something like @media only screen and (min-width : 1224px) to target desktops then a user needs to have their browser window maximized or they get tablet targeted css. So if a desktop users browser is at 1000px then they get the same css as someone on an Ipad. Now I'm told that browser sniffing is unreliable so how else can I differentiate between a user on a 1000px desktop browser and a 1000px tablet device?

like image 984
Pollux Khafra Avatar asked Aug 19 '12 17:08

Pollux Khafra


People also ask

What screen size should I design for desktop?

As for the desktop version, the best choice is the 1280×720 screen resolution. It is a minimal size for desktop devices. Usually, the desktop version is user-friendly and perfectly readable if the screen resolution width is more than 1280.

What is the most common screen size used for Web design?

The following are some of the most common screen resolution options: Desktop displays, ranging from 1024×768 to 1920×1080. Mobile displays ranging from 360×640 to 414×896. Tablet displays ranging from 601×962 to 1280×800.

What is the most common screen size for website design 2021?

According to the Worldwide Screen Resolution Stats (Jan 2020 – Jan 2021), the most commonly used resolutions across mobile, desktop, and tablet are: 1920×1080 (8.89%) 1366×768 (8.44%) 360×640 (7.28%)

What is tablet screen resolution?

Average tablets have a resolution of 1920x1080 pixels.


1 Answers

body {
  background-color: #bada55
}


/* Regular media queries for a smaller desktop */
@media only screen 
and (min-device-width : 768px) 
{
/* Add styles here */
} 



/* iPads (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
/* Add styles here */
}

/* iPads (landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) {
/* Add styles here */
}

/* iPads (portrait) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) {
/* Add styles here */
} 

Check the example in jsbin - http://jsbin.com/uxipeh/1/ and a full list of options here

like image 131
justinavery Avatar answered Sep 21 '22 18:09

justinavery