出于某种原因,我在 css 中的整页背景不起作用。我以前做过一次,效果很好,但现在我得到的只是白色背景。这是我相关css代码的一部分:
* {
margin: 0;
padding: 0;
}
/* render html5 elements as block */
header, footer, section, aside, nav, article {
display: block;
}
html {
line-height: 1;
color: #555;
font-family: 'Trebuchet MS', Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
background-image: url(file:///HD/Users/Barbra/Sites/HSMAI/images/vbcc_background.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
- moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/* layout */
#wrapper {
width: 960px;
margin: 0 auto;
background-image: linear-gradient(bottom, #86D1C7 5%, #A8BCFA 53%);
background-image: -o-linear-gradient(bottom, #86D1C7 5%, #A8BCFA 53%);
background-image: -moz-linear-gradient(bottom, #86D1C7 5%, #A8BCFA 53%);
background-image: -webkit-linear-gradient(bottom, #86D1C7 5%, #A8BCFA 53%);
background-image: -ms-linear-gradient(bottom, #86D1C7 5%, #A8BCFA 53%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.05, #86D1C7),
color-stop(0.53, #A8BCFA)
);
border: 2px solid #333;
/* curved border radius */
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
我确定所有文件都在正确的位置,并且所有链接都正确指定。