Home  >  Article  >  Web Front-end  >  手机网页制作_html/css_WEB-ITnose

手机网页制作_html/css_WEB-ITnose

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

手机网页制作与电脑网页制作有什么区别,手机网页的自适应是怎么做到的啊


回复讨论(解决方案)

用%,尽量避免px

还有一个是@media(max-height: 480px){

}

和楼上一样,手机面对的主要问题的手机的高度不一。宽度自适应倒好办,我常用JS计算高度,字体大小用%

可以使用jquery来控制样式,一般以适配4和6plus为标准,采用谷歌浏览器调试,小米手机特别关注一下样式。

自己封装个js,算出设计图和屏幕的宽度比,以自定义属性的方式赋值(设计图上得值),当页面载入的时候,取出属性的值乘以比值,付给样式,这样比较简单,不然的话,每个页面都得用js去计算,很复杂!

最简单的就是百分比

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