Html 背景图像没有显示。为什么?

Html 背景图像没有显示。为什么?,html,css,Html,Css,我真的卡住了。我是CSS的初学者,我尝试使用背景图像 当我不使用参数no repeat时,一切正常,但如果不使用no repeat,图像不会显示。这是尺寸问题吗 我试过和你一起工作,但这也不起作用 非常感谢任何帮助 bg服务{ 背景图片:url'http://www.sternwarte-radebeul.de/Images_vstw/fotos/sterngucker.jpg"不重复,; } 特雷汉德费南森酒店 如果你是一位金融界人士,那么你是否会对金融界的金融危机感到担忧? 使用: 如果

我真的卡住了。我是CSS的初学者,我尝试使用背景图像

当我不使用参数no repeat时,一切正常,但如果不使用no repeat,图像不会显示。这是尺寸问题吗

我试过和你一起工作,但这也不起作用

非常感谢任何帮助

bg服务{ 背景图片:url'http://www.sternwarte-radebeul.de/Images_vstw/fotos/sterngucker.jpg"不重复,; } 特雷汉德费南森酒店 如果你是一位金融界人士,那么你是否会对金融界的金融危机感到担忧?

使用:

如果要使用背景图像,请使用以下选项:

#bg--service {
    background-image: url(../img/sternengucker.jpg);
    background-repeat: no-repeat;
}
然后读一下:

或者关于背景及其属性的完整文档。

您在属性中使用的是速记符号,这不起作用

改变

background-image: url(../img/sternengucker.jpg) no-repeat;

或者使用两个单独的规则,如:

background-image: url(../img/sternengucker.jpg);
background-repeat: no-repeat;

背景图像仅接受图像属性

如果您使用以下选项,它将起作用:

background-image: url('../img/sternengucker.jpg');
background-repeat: no-repeat;
您可以在此处阅读有关背景图像属性的更多信息:

您还可以使用背景速记:

background: url('../img/sternengucker.jpg') no-repeat top left;
此链接显示有关背景速记的更多信息:

background: url('../img/sternengucker.jpg') no-repeat top left;
背景图像和背景重复是背景属性的子属性,因此要修复它,背景图像应替换为背景

bg服务{ 背景:url'http://www.sternwarte-radebeul.de/Images_vstw/fotos/sterngucker.jpg"不重复,; } 特雷汉德费南森酒店 如果你是一位金融界人士,那么你是否会对金融界的金融危机感到担忧?


尝试使用background属性而不是background imageWhy downvote?但是谢谢不客气我没有投反对票
background: url('../img/sternengucker.jpg') no-repeat top left;