我正在尝试让我的网站类似于 http://allfiredupinc.com/所以当你向下滑动时它不显示背景,然后显示内容。此外,当您向上滚动时,它会显示背景。
body {
background: url("http://uploadir.com/u/j027zo9j") no-repeat top center fixed;
background-size: cover;
}
我怎样才能添加这样的内容?它显示的漂亮的小效果?
最佳答案
将 margin-top
添加到您的内容容器,因此如果您的内容容器有一个 ID #main-content
,您可以为其指定以下样式:
#main-content {
/* Adjust this value as you want */
margin-top: 30em;
/* Other properties */
...
}
关于html - 图片滑动背景内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29584948/