【问题标题】:How would I go about making the background image repeatedly scroll vertically?我将如何使背景图像重复垂直滚动?
【发布时间】:2016-08-03 22:33:39
【问题描述】:

这可以仅使用 HTML5 和 CSS3 来完成,还是我需要使用 JavaScript/jQuery?

【问题讨论】:

标签: javascript jquery html css


【解决方案1】:

你可以添加一个css属性:background-repeat:repeat-y;

这是一个例子:

body {
  background-image:url('https://mdn.mozillademos.org/files/12005/starsolid.gif');
  background-repeat: repeat-y;
  background-position: top;
}

h1, p {
  color: white;
}
<body>
  <h1>H1 heading</h1>
  <p>This is the content</p>
</body>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-26
    • 2014-10-03
    • 1970-01-01
    • 1970-01-01
    • 2013-07-30
    相关资源
    最近更新 更多