Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

我在仿一个网页,源代码是把像素写成固定的,但是在手机上浏览,但是却不被破坏,这是为什么?

我最近在仿一个网站的首页,右键查看源代码的时候,发现最外层盒子都是固定成960px,然后margin:0 auto;按道理在手机上打开的时候是产生滚动条的,但是整个页面却缩放成与手机一样大小,是因为引用了什么插件吗?还是什么原因?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

在代码里没指定 width=device-width 的情况下, 浏览器会使用物理分辨率, 把页面整体缩小到1/dpr


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...