The main problem with handheld styles is that you do not give users the opportunity to select content that is delivered to their phone. Nowadays, phones are much more powerful than before, and it is a bit annoying when a website sees that you are accessing from a mobile device and provides you with a simplified version, despite the fact that the device easily supports a full version of the site.In general, this is the logic, the latest versions of mobile browsers in their display capabilities are not inferior to their desktop counterparts.
<! β- connect styles for Opera, Safari, Firefox, Chrome desktop browsers ->
<link rel = "stylesheet" type = "text / css" href = "css / style.css" media = "screen and (min-width: 601px)" />
<! β- connect styles for Internet Explorer ->
<! - [if IE]>
<link rel = "stylesheet" type = "text / css" href = "css / style.css" media = "screen" />
<! [endif] ->
<! β- connect styles of mobile version ->
<link rel = "stylesheet" type = "text / css" href = "css / handheld.css" media = "handheld, only screen and (max-width: 600px)" />
<! β- connect print styles ->
<link rel = "stylesheet" type = "text / css" href = "css / print.css" media = "print" />
<! β- connect styles common to all versions ->
<link rel = "stylesheet" type = "text / css" href = "css / content.css" media = "all" />
Let's sort the code:<link rel = "stylesheet" type = "text / css" href = "css / style.css" media = "screen and (min-width: 601px)" />The style should be applied to browsers with a display width of at least 601 pixels. In general, it would be more correct to write media = βonly screen and (min-width: 601px)β, but then Firefox would remain without styles (Media Queries promise to be implemented in the next version 3.1 / 3.5).
<! - [if IE]>
<link rel = "stylesheet" type = "text / css" href = "css / style.css" media = "screen" />
<! [endif] ->
We connect styles for all versions of Internet Explorer (support for Media Queries is not yet known).<link rel = "stylesheet" type = "text / css" href = "css / handheld.css" media = "handheld, only screen and (max-width: 600px)" />We connect styles for all mobile browsers, as well as desktop browsers with a display width of no more than 600 pixels. This width is chosen so that not only mobile phones and PDAs, but also netbooks fall into it.




Source: https://habr.com/ru/post/58486/
All Articles