為什么這里測出來的是等于450呢?
為什么這里測出來的是等于450呢?
<!doctype?html> <html> <head> <meta?charset="utf-8"> <meta?name="viewport"?content="width=320"?> <title>無標題文檔</title> <style?type="text/css"> *{?padding:0;?margin:0;} .pic{?width:320px;?height:568px;?background:#ffe872;?color:#fff;?font-size:150px;?text-align:center;?line-height:1136px;?background-size:auto;} </style> </head> <body> <div?class="pic">yellow</div> </body> </html>
2015-12-17
因為你的字體太大太長了,把度量viewport撐開了。設備會根據頁面大小,為顯示整個頁面,自動調整縮放比。
如果你的和我一樣的話,視圖中的縮放比應該是0.7。你把字體調小一些,比如調成15px,那么你重新打開頁面,度量viewport和布局viewport就會一樣了,此時縮放比也就是1了。