[英]Page not scaling to fit the viewport on mobile
My page is not scaling to fit the viewport of mobile device even though I have put the meta tag: 即使放置了meta标记,我的页面也无法缩放以适合移动设备的视口:
<meta name="viewport" content="width=device-
width, initial-scale=1"> in the <head>.
When the page loads, the page is too large and does not fit the screen. 页面加载时,页面太大,不适合屏幕。
css for body is 身体的CSS是
body, html {
position: relative;
display: block;
height: auto;
width: 100%;
max-width: 1650px;
min-width: 400px;
min-height: 650px;
margin-left: auto;
margin-right: auto;
}
I would appreciate any help. 我将不胜感激任何帮助。 Thanks! 谢谢!
Try a media query with max-width: 100%
and min-width: 100%
property like this: 尝试使用max-width: 100%
和min-width: 100%
属性的媒体查询,如下所示:
@media (max-width: 768px) {
body,html {
max-width: 100%;
min-width: 100%;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.