Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS背景位置不工作_Css_Background Image_Background Position - Fatal编程技术网

CSS背景位置不工作

CSS背景位置不工作,css,background-image,background-position,Css,Background Image,Background Position,我这里有这个代码 .madactive{background: url(/graphics/madarrow.jpg) no-repeat center top 20px !important;} 但是图像不再出现,我检查了元素,css被划掉了 我想做的是在我的背景图像上加一个顶部 我做错了什么?声明值中的参数太多。根据您的具体需要,以下任一项都可以使用: .madactive{background: url(/graphics/madarrow.jpg) no-repeat center t

我这里有这个代码

.madactive{background: url(/graphics/madarrow.jpg) no-repeat center top 20px !important;}
但是图像不再出现,我检查了元素,css被划掉了

我想做的是在我的背景图像上加一个顶部


我做错了什么?

声明值中的参数太多。根据您的具体需要,以下任一项都可以使用:

.madactive{background: url(/graphics/madarrow.jpg) no-repeat center top !important;}


声明值中的参数太多。根据您的具体需要,以下任一项都可以使用:

.madactive{background: url(/graphics/madarrow.jpg) no-repeat center top !important;}

20像素是干什么用的?您正在定义中心顶部的位置20px的用途是什么?您正在定义中心顶部的位置