First of all, let's take a look at the Windows 8 stickers. In Windows 8, the Metro application can well split the screen. For example:
This allows you to easily switch between instances during use. The system also has rigid rules on posting. A maximum of two screens, one large and one small. The width of the small screen is fixed to 320 pixels.
Therefore, when you paste a website into a small screen, the page is scaled down by default. For example:
So how can this problem be solved well? What kind of friendly effect does the website display on a small screen on Windows 8? Below is a simple example.
A simple and traditional page, including horizontally arranged navigation and content.
The traditionalCodeThe same is true.
<! Doctype HTML> <HTML xmlns = "http://www.w3.org/1999/xhtml">
The effect of such a page is reduced:
How to modify it? In this traditional page, we only need to compile a CSS based on the features of Windows 8 so that the page can be laid out and displayed in a 320 pixel width.
The implementation code is as follows: add the following style code to the original page
@ Media screen and (max-width: 320px) {@-MS-viewport {width: 320px ;}. NAV {padding: 5px 0px 5px 0px; margin: 0px; width: 100%; Background-color: # fff ;}. NAV Li {width: 300px; clear: Both; margin: 0px 0px 1px 0px; Background-color: # 0094ff; padding: 5px 0px 5px 0px ;}. dvitem {width: 95%; Height: 600px; Background-color: # ff00a4; clear: Both ;}. main {width: 320px; margin: 0px auto 0px auto ;}}
There is no difference between full-screen browsing and traditional browsing.
The difference is that it is obvious to stick him to a small screen, such as the display effect.
Download/files/risk/index.rar in this example.