【问题标题】:Can't add a my own background for to the footer of Twenty Eleven Wordpress theme无法为 21 Wordpress 主题的页脚添加我自己的背景
【发布时间】:2013-07-15 02:55:06
【问题描述】:

我一直在尝试对 wordpress 主题 211 做一些小的编辑,但看起来有点棘手。

我试图做的是改变页脚的背景。我一直在直接编辑footer.php。我能够改变它的背景颜色。但是我在添加图像作为背景时失败了。

这是我编辑后的代码...(我添加了红色作为背景色)

<footer style = "background: red; width: 100%;"  id="colophon" role="contentinfo">

此代码运行良好.. 但请看以下...

<footer style = "background:url('images/body.jpg'); width: 100%;"  id="colophon" role="contentinfo">

这行不通!我很困惑...

有人可以帮帮我吗?

【问题讨论】:

  • 主题页脚的CSS?请
  • 如果红色有效,则表示尚未找到 images/body.jpg。检查链接,并记住:它是相对于页面的!
  • wordpress中的路径通常从/wp-content/目录开始

标签: css wordpress


【解决方案1】:

使用

#colophon{
  background-image: url('yourimageurl');
}

在 style.css 中

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-18
    • 2021-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多