PC端如何实现viewport的缩放效果?
html吧
全部回复
仅看楼主
level 2
sosovipp
楼主
手机端一句
<meta name="viewport" content="width=1000,minimum-scale=0.5,maximum-scale=2.0,user-scalable=no"/>
就解决了
不过PC端这句不管用,有什么好办法?
最好是一句代码就解决问题。
2017年05月05日 07点05分
1
level 2
绘图员老李
你好,想到办法了吗?
2017年06月14日 06点06分
2
sosovipp
没
2017年06月14日 07点06分
绘图员老李
有人说用rem 可以实现
2017年06月14日 09点06分
sosovipp
rem 只是解决字体缩放,搞不了整页的缩放。
2017年06月15日 01点06分
绘图员老李
确实是。rem解决字体大小问题 百分百解决布局问题
2017年06月18日 03点06分
level 1
o0嘭嘭0o
头痛...我也是刚刚真机测试的时候才发现原来viewport是不能在PC上缩放的..一直被chrome蒙在鼓里
2017年07月10日 18点07分
3
level 1
nothingbok
找到解决办法了吗,老铁
2018年10月11日 02点10分
4
sosovipp
只能做成响应式了
2018年10月11日 05点10分
sosovipp
楼下有主要代码。另外,宽度得改成百分比。
2018年10月11日 05点10分
nothingbok
@sosovipp
看了,就是说PC没法设置缩放呗,只能多媒体查询
2018年10月11日 06点10分
level 2
sosovipp
楼主
head标签里加上:
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=yes"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style2.css" media="screen and (max-width: 1220px)">
<link rel="stylesheet" type="text/css" href="css/style3.css" media="screen and (max-width: 900px)">
style2.css、style3.css 是另外2个宽度对应的修正样式。
2018年10月11日 05点10分
5
1