为什么720*1280的屏幕网页却不能是720宽_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:23:27
Original
1367 people have browsed it

<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1.0" /><meta charset="UTF-8" /><style type="text/css">*{margin:0px;}div{    width:700px;    height:200px;    border:solid 1px #000000;}</style></head><body><div>123</div></body></html> 
Copy after login
Copy after login


回复讨论(解决方案)

刚才的回帖不知道什么原因,怎么弄没了呢。。
懒得写了
你查下:window.devicePixelRatio

http://www.cnblogs.com/qq21270/p/3785961.html

刚才的回帖不知道什么原因,怎么弄没了呢。。
懒得写了
你查下:window.devicePixelRatio

http://www.cnblogs.com/qq21270/p/3785961.html



您好。我看了那个文章。

可是我还是有疑问。

我手机是1280*720 就是说我手机宽720像素。
可是我把网页设置成720px网页却超出了屏幕范围div{width:720px;}
请问是为什么

我把div{width:360px;}网页就不超宽。请问这是怎么回事???

我总有可能给div设置宽度啊!!!

按百分比定位宽度。
刚才才发现你发了两篇,我给回复到 html5那个版里了

<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1.0" /><meta charset="UTF-8" /><style type="text/css">*{margin:0px;}div{    width:700px;    height:200px;    border:solid 1px #000000;}</style></head><body><div>123</div></body></html> 
Copy after login
Copy after login



因为你设置了 width=device-width

1280*720 的手机  应该是高清屏吧 像素点是这样  实际是 一半

meta改一下试试

content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template