In many of the questions and answers on stackoverflow.com users recommend using min-width
and max-width
to identify target device is smartphone or PC (this, this, this questions and many more). Like this:
<link href="template.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 1024px)" />
<link rel="stylesheet" media="only screen and (min-width: 0px) and (max-width: 327px)" href="mobile.css">
<link rel="stylesheet" media="only screen and (min-width:328px) and (max-width: 768px)" href="templates/template/tablet.css">
But today, the resolution of mobile phones has increased dramatically and most mobile phones and computers have the same number of pixels in their width and using this method is not efficient. Is there any alternative method for identify target device?
Update - “A Pixel is Not a Pixel”
This page have very good information about this: Understanding the Difference Between CSS Resolution and Device Resolution