duanbi9202 2011-04-29 21:27
浏览 34

我的新博客标题图片没有显示...如何正确编写代码?

From what I can understand I may need to modify both the header.php file as well as the style.css file. I've uploaded the image to the hosting website and I believe it is a relative link: (/public_html/wp-content/themes/sandbox/Header-1.jpg)

So. This is the style.css code I have:

#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; }

This is the original php in header.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 -->

I've tried replacing the h1 id and the div id lines with

<img src= "/public_html/wp-content/themes/sandbox/Header-1.jpg"/>

but that wasn't effective.

Right now the website has no header and can be seen here: www.dearjasmina.com

Thanks for your time!

  • 写回答

5条回答 默认 最新

  • duansha8764 2011-04-29 21:31
    关注

    The path you're using is incorrect. It should be /wp-content/themes/sandbox/Header-1.jpg.

    So you're css should read

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

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100