I rely on two elements to optimize sites for mobile browsers (especially Android and iPhone):
Meta Tags: HandheldFriendly and viewport
I usually want pages to not have a page width of 800 to 900 pixels, since the Android and iPhone browsers set it by default. So that the page width is the same as the width of the device, I set the following meta tags:
<meta name="HandheldFriendly" content="true" /> <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
CSS Media Requests
I adapt the design to the width of the page. For example, the presence of two columns for large screens and 1 column for small screens and printing. Thus, I include further css-include with the media in the main css main file:
@import url(style-screen.css) screen; @import url(style-small.css) print, handheld; @import url(style-large.css) screen and (min-width: 801px); @import url(style-small.css) screen and (max-width: 800px);
Daniel Aug 07 2018-10-12T00: 00Z
source share