0

我正在尝试为我的 wordpress 网站设置背景图片。

.content:before {
content: "";
background-image: url("gfx/SevenWonders.jpg");
/*background: #fff;*/
background-size:600px 700px;
background-repeat: no-repeat;
position: absolute;
z-index: -9999;
top: 0;
right: 28.5%;
bottom: 0;
left: -10000px;
}

这是我的带有背景图像的 CSS 代码。我调整了大小,因为图像

对我的网站来说相当大。和!添加 background-repeat: no-repeat 后,

背景不可显示。我只看到白色背景。

当然,我用谷歌搜索找到解决方案,但几乎所有人都在说

关于语法错误,但我在我的代码中找不到任何语法错误..

4

1 回答 1

0

检查这个小提琴。问题在于您left在 css 中的属性值。

.content:before {
content: "";
background-image: url("https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=350&h=150");
/*background: #fff;*/
background-size:600px 700px;
background-repeat: no-repeat;
position: absolute;
z-index: -9999;
top: 0;
right: 28.5%;
bottom: 0;
left: 0px;
}
于 2017-04-28T13:58:37.537 回答