0
我有背景,但是当我做出页脚时,身体的背景图像跨越到页脚;我怎样才能将这个背景限制在身体上?这里是我的代码:将背景图片仅限于身体
body {
font-family: 'Open Sans', sans-serif;
background: #282828;
color: #fff;
padding-top: 20px;
background: linear-gradient(-45deg, #EE7752, #E73C7E, #FF7F50, #23A6D5, #FF7F50);
background-size: 400% 100%;
background-repeat: no-repeat;
-webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite;
animation: Gradient 15s ease infinite;
}
<div class="footer">
<p>Posted by: asds</p>
<p>Contact information: <a href="mailto:[email protected]">
[email protected]</a>.</p>
</div>
我没有看到一个背景图片?如果您不想让身体的背景显示出来,请在页脚上设置背景。 – Slime
页脚是'body'的一部分,所以如果你想要一个不同的页脚背景,你必须为页脚定义一个背景。或者,不要将背景放在'body'上,而是为'body'中的'body'内容创建一个容器,该容器不包含页脚代码并将背景应用于该内容。 – APAD1