2011-04-29 45 views
1

从我可以理解,我可能需要修改header.php文件以及style.css文件。我已经将图像上传到托管网站,我相信它是一个相对链接:(/public_html/wp-content/themes/sandbox/Header-1.jpg)我的新博客标题图像未显示...如何正确编写代码?

所以。这是style.css的代码,我有:

#header { border-bottom:none; 
    height:200px; 
    padding-top:0; 
    padding-bottom:0; 
    background:url("/public_html/wp-content/themes/kid/Header-1.jpg") 
    no-repeat bottom center; } 


#headerimg { 
     height: 200px; 
     width: 800px; } 

这是header.php中原来的PHP

<div id="header"> 
     <h1 id="blog-title"><span><a href="<?php bloginfo('home') ?>/" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?>" rel="home"><?php bloginfo('name') ?></a></span></h1> 
     <div id="blog-description"><?php bloginfo('description') ?></div> 
    </div><!-- #header --> 

我试着

更换H1 id和DIV ID线
<img src= "/public_html/wp-content/themes/sandbox/Header-1.jpg"/> 

但这并不奏效。

眼下的网站有没有头,可以在这里看到:www.dearjasmina.com

感谢您的时间!

回答

1

您使用的路径不正确。它应该是/wp-content/themes/sandbox/Header-1.jpg

所以你的CSS应该阅读

#header { 
    height:200px; 
    padding-top: 0; 
    padding-bottom: 0; 
    background:url('/wp-content/themes/kid/Header-1.jpg') no-repeat bottom center; 
} 
0

看来好像相对的URL是不正确。尝试删除/public-html。在你的图像路径

0

删除的public_html文件夹,使用如下
<img src="/wp-content/themes/sandbox/Header-1.jpg">

0

有404未找到你的图像上,根据IE网络嗅探。仔细检查你的网址。

相关问题