On stackoverflow.com, users often suggest using min-width
and max-width
to differentiate between smartphones and PCs (here, here, here and more). Here's an example:
<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">
However, with the increasing resolution of mobile phones, this method may not be as effective since most devices now have similar pixel width. Are there alternative methods to identify target devices?
Update - “A Pixel is Not a Pixel”
This resource provides valuable information on this topic: Understanding the Difference Between CSS Resolution and Device Resolution