Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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
不工作:整个页面的单个背景图像(页眉+主要内容)wordpress_Wordpress_Css_Background Image - Fatal编程技术网

不工作:整个页面的单个背景图像(页眉+主要内容)wordpress

不工作:整个页面的单个背景图像(页眉+主要内容)wordpress,wordpress,css,background-image,Wordpress,Css,Background Image,在WordPress中,我似乎无法在整个页面的背景中显示一幅图像,其中包括页眉、导航栏和主内容页 对于此站点: 使用单页登录子主题Simone by Mor10 我可以使用WordPress仪表板在实际页面上插入一个div class=图像,并使其在导航栏下方出现,文本框后面是 但是我想让图像也在标题的背景中 CSS: 我尝试过但不起作用的方法,同时始终保留name.image,这样我就不必更改css: 添加到header.php文件中。 注意:header.php中的原始编码不会关闭- div

在WordPress中,我似乎无法在整个页面的背景中显示一幅图像,其中包括页眉、导航栏和主内容页

对于此站点:

使用单页登录子主题Simone by Mor10

我可以使用WordPress仪表板在实际页面上插入一个div class=图像,并使其在导航栏下方出现,文本框后面是

但是我想让图像也在标题的背景中

CSS:

我尝试过但不起作用的方法,同时始终保留name.image,这样我就不必更改css:

添加到header.php文件中。 注意:header.php中的原始编码不会关闭-

div id=内容类=网站内容>

像这样:

body <?php body_class(); ?>>
div id="page" class="hfeed site">
div class="image">
header id="masthead" class="site-header" role="banner">
a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'simone' ); ?></a>

<?php if ( get_header_image() && ('blank' == get_header_textcolor()) ) { ?>

 <figure class="header-image">
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
       <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
    </a>
 </figure>
我还将类id添加到其他现有div中,但运气不佳。

使用以下代码:

body {
background: url("http://sheiler.info/latin/wp-content/uploads/2014/08/latinh-logo.png") no-repeat 50% !important;
background-size: cover;
}

请确保没有任何元素与背景重叠。我可以看到您的标题有一个.site branding类与背景重叠,并且可能还有更多内容。

您是否尝试使用背景图像!对body很重要?我在开发者工具上试过了,得到了404找不到/latin/wp content/themes/simone/images/latinh logo.png:1得到了404找不到latinh logo.png:1最奇怪的是,我从你那里复制了链接本身,它可以工作,但当我把它放进去的时候它不能工作。但它应该可以。我在FF中试过开发者工具,它工作得很好,事实上,我就是这样测试的。看起来你没有阅读http部分,但在我这方面效果很好。你也可以把它上传到你主题的images文件夹,然后加载images/latinh-logo.png,就是这样,没有http问题我注释掉了所有的背景,除了我把它改成背景的2个实例:无;然后我复制了法比奥在上面给出的代码,并将其放入lander-style.css子样式文件中,没有任何内容。然后我将其添加到父样式主题文件中。没有什么我是否需要通过父母的风格,并删除所有的背景有太多,除了身体?不,它没有工作。所以我换到了另一个主题。我没想到对我来说做这么基本的事情会这么棘手,但事实就是这样。谢谢
body {
background: url("http://sheiler.info/latin/wp-content/uploads/2014/08/latinh-logo.png") no-repeat 50% !important;
background-size: cover;
}