我想知道是否有一种方法可以使我的背景图像始终保持在左下角,即使用户滚动浏览器也是如此。我当前的CSS可以在网站加载时使图像位于浏览器底部,但是如果我滚动浏览器,它仍然会停留在同一位置。我很感激任何帮助。
html, body
{
background-image:url("backgroundBottom.png");
background-position:bottom left;
background-repeat:no-repeat;
background-attachement:fixed; //I just add this, don't think this would work.
font-family:"Georgia, self";
font-size:"30px";
margin:0px;
height:100%;
text-align:center;
}
您正在设置 HTML 和 BODY 元素的背景。
代码看起来不错,background-attachment:fixed就是你所需要的。
所以在简写 CSS 中,只需写
body {
background: url(backgroundBottom.png) bottom left no-repeat fixed;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)