页面正文中的最小宽度不起作用 [英] min-width in page body not working
本文介绍了页面正文中的最小宽度不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的网站上设置了最小宽度767px,以避免在智能手机上查看网站时缩小的一切。
问题是,它似乎没有考虑到(见下面的截图)
任何想法为什么?
非常感谢
CSS:
html,
body {
height:100%;
min-width:767px;
-webkit-font-smoothing:antialiased;
text-shadow:1px 1px 1px rgba(0,0,0,0.004);
background:url('../ images / background-produits.jpg')无重复中心固定;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
font-family:'Open Sans';
font-size:16px;
font-weight:300;
line-height:1.38;
color:rgb(71,64,50);
解决方案
绝对定位的东西。为了正常工作,您需要将它们包含在具有相对定位的项目中。是的,甚至是身体标记,显然。
body {position:relative}
I have set a minimum width of 767px on my website to avoid everything to be shrunk when viewing the website on a smartphone. The issue is that is that it doesn't seem to be taken into consideration (see screenshot below) Any idea why? Many thanks
CSS:
html,
body {
height: 100%;
min-width: 767px;
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
background: url('../images/background-produits.jpg')no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: 'Open Sans';
font-size: 16px;
font-weight: 300;
line-height: 1.38;
color: rgb(71, 64, 50);
}
解决方案
You've got a lot of things positioned absolutely. For that to work correctly you need to have them contained in an item with relative positioning. Yep, even the body tag, apparently.
body {position: relative}
这篇关于页面正文中的最小宽度不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文