请帮助 - 新的网页设计。为什么不背景大小:盖工作?由于某种原因,它忽略覆盖并重复它 [英] Please help - new to web design. why wont background-size:cover work? for some reason it ignores cover and repeats it
本文介绍了请帮助 - 新的网页设计。为什么不背景大小:盖工作?由于某种原因,它忽略覆盖并重复它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CSS - 这是我写的CSS。我不知道为什么背景颜色重复,而不是像我说的覆盖。对不起,如果它的愚蠢的错误,我非常新的编码和网页设计。先感谢您的帮助:)
CSS - This is the css i have written. Im not sure why the background color repeats instead of covering like i said. Sorry if its a dumb mistake, im very new to coding and web design. Thank you in advance for your help :)
body{ background-repeat: no-repeat;
-webkit-background-size: cover;
color-stop(41%,rgba(41,137,216,1)), color-stop(77%,rgba(125,185,232,1))); /* Chrome,Safari4+ */
color:#000000;
font-family:Georgia,Arial,Serif;
font-size: 12px;
}
figure {
float:left;
}
.question {color: blue; font-size: 20px;}
.answer {color: green; font-size: 16px;}
#taskpic {float:right;}
#audience {float:left; width: 550px; font-size: 16.5px}
#back {font-size: 15px;}
#main{float:left; color:black; width: 160px; border: 1px solid brown; border-style:double; padding: 2px ; font-size: 18.5px; }
#youarehere { color: black;}
#name {border: 1px solid blue;
padding-left: 515px; }
figure figcaption {
text-align: center;
}
ul {
float:right;
border: 1px solid blue ;
width:200px;
list-style-type:none;
font-size: 25px;
font-weight: bold;
}
li a:link {
color: red;
}
li a:visited {
color: red;
}
li a:focus {
color: red;
}
li a:hover {
color: blue;
}
li a:active {
color: blue;
}
a:link {
color: black;
}
a:visited {
color: black;
}
a:focus {
color: black;
}
a:hover {
color: red;
}
a:active {
color: red;
}
h2 a:link {
color: pink;
}
h2 a:visited {
color: pink;
}
h2 a:focus {
color: pink;
}
h2 a:hover {
color: red;
}
h2 a:active {
color: red;
}
推荐答案
https://developer.mozilla.org/en-US/docs/Web/CSS/background-size =nofollow> MDN
To quote MDN
background-size CSS属性指定背景图片的大小。
关键字有图片。大小不适用于颜色或渐变。
The key word there is images. Size will not apply to color or gradients.
这篇关于请帮助 - 新的网页设计。为什么不背景大小:盖工作?由于某种原因,它忽略覆盖并重复它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文