Home >Web Front-end >HTML Tutorial >Mobile web page production_html/css_WEB-ITnose

Mobile web page production_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:581021browse

What is the difference between mobile webpage production and computer webpage production? How is the mobile webpage adaptive?


Reply to the discussion (solution)

Use % and try to avoid px

Another one is @media(max-height: 480px){

}

Same as above, mobile phone The main problem faced by mobile phones varies in height. Width adaptive is easy to handle. I often use JS to calculate the height, and use % for font size.

You can use jquery to control the style. Generally, it is adapted to 4 and 6plus as the standard. Use Google Chrome to debug. Pay special attention to Xiaomi phones. style.

Encapsulate a js yourself, calculate the width ratio between the design drawing and the screen, and assign the value in the form of a custom attribute (the value obtained from the design drawing). When the page is loaded, take out the attribute value and multiply it by the ratio. It is simpler to pay for the style. Otherwise, each page has to be calculated using js, which is very complicated!

The simplest one is percentage

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn