我试图使用CSS3背景大小来适合页面高度的背景,但它只适用于宽度,但不适用于高度。背景大小不适合元素
我打算让这个背景图像适合100%的页面宽度和高度,即使在打破它的比例时,我也没有看到问题,因为我使用background-size:100%100%;和
The percentage is relative to the width or height of the area given by 'background-origin'
(任何背景,出身值改变不了什么)
我需要了解为什么我不能使背景的高度,以适应<body>
一些提示?我怎么能这样做?
这里是我的CSS的一部分:
html {
height:100%;
min-height:100%;
}
body {
min-height:100%;
margin:0;
padding:0 2em;
background:#474747 url(../images/bg.jpg) 100% 0 no-repeat;
background-size:100% 100%; /* raaaaaah */
font-family:Cambria,serif;
min-width:910px;
position:relative;
}
提前感谢!
编辑:您可以http://matthecat.com/v2/blog.html
我不能使用固定的背景,因为滚动发生滞后。 – MatTheCat 2011-03-30 13:23:08