CSS CSS无效的属性值?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16248295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CSS Invalid Property Value?
提问by Manuel Medina
I don't understand what's wrong with this? I'm watching a tutorial and it seems to work fine on the video but both mozilla and chrome ignore this code and marks it as an invalid property value.
我不明白这有什么问题?我正在看一个教程,它似乎在视频上运行良好,但 mozilla 和 chrome 都忽略了此代码并将其标记为无效的属性值。
.btn {
background-color: #4FB69F url("img/texture.png") no-repeat right top;
}
回答by Dipesh Parmar
change
改变
background-color:
to
到
background:
Because background
is a shorthand property for
因为background
是一个简写属性
- background-color
- background-image
- background-position
- background-repeat
- background-attachment
- 背景颜色
- 背景图片
- 背景位置
- 背景重复
- 背景附件
回答by user7340463
background-color: #4FB69F;
background-image: url('images/texture.png');
background-repeat: no-repeat;
background-position: right top;
Within the image url requires 'not "Background position is separate from no repeat and ;between each element control
图像url内要求'非'背景位置是分开的,没有重复和;在每个元素控件之间