我在Wordpress二十七中通过CSS添加了“background-image”:不显示

问题描述 投票:0回答:3

我想通过CSS添加我自己的背景图像来覆盖Wordpress Twenty-Seventeen标题图像。但是,它只显示空白...这是身体的html:

<body class="page-template-default page page-id-5 logged-in wp-custom-logo has-header-image page-one-column title-tagline-hidden colors-light page-soins" data-aos-easing="ease" data-aos-duration="400" data-aos-delay="0" cz-shortcut-listen="true">

这是我的CSS禁用wordpress标题图像:

.page-soins .wp-custom-header {
display: none;

}

这是我的CSS添加我的背景图像:

body.page-soins {
    background: url("images/backgrounds/soins-bg-1.jpg") no-repeat center center fixed;
    background-size: cover;
}

最后,这是该页面的链接:www.http://latelierdegaia.ch/soins/

有人可以帮忙吗?非常感谢!

html css wordpress background-image twentyseventeen
3个回答
1
投票
.site-content-contain

.site-mast-head

都有

background-color: #fff;

它涵盖了你的background-image


0
投票

我找到了一个可以解决的解决方法!但是诀窍呢。我刚刚将CSS背景图像添加到“site-header”类而不是“body”。

body.page-soins .site-header {
    background: url("images/backgrounds/soins-bg-1.jpg") no-repeat center center fixed;
    background-size: cover;
}

0
投票

你只需要从background-color: #fafafa;类中删除.site-header

© www.soinside.com 2019 - 2024. All rights reserved.