【问题标题】:WordPress 85% Width Content Div BackgroundWordPress 85% 宽度内容 Div 背景
【发布时间】:2013-10-26 03:28:38
【问题描述】:

我管理着一个 WordPress 网站,在主内容 div 后面应用自定义背景时遇到了一些问题。这是该网站的链接:AccelePedia。您会看到主要内容 div 设置为 85% 宽度,并且每一边都是空白。我已经尝试了所有方法,但我无法将背景应用到那个空白区域。我在下面包含了与我们正在查看的 div 相关的代码。在这里的任何帮助将不胜感激。 :)

如果有帮助的话,我正在运行带有 2013 主题的 Wordpress 3.6.1。 (我已经修改了。)

谢谢!

/**
* 3.0 Basic Structure
* ----------------------------------------------------------------------------
*/

body
{
    background: url(http://accelepedia.com/accimages/background02.png) repeat-x top     left;
    width: 100%;
}

.site {
    background: url(http://accelepedia.com/accimages/background02.png) repeat-x top     left;
    border-left: 1px solid #f2f2f2;
    border-right: 1px solid #f2f2f2;
    max-width: 1600px;
    width: 100%;
}

.site-main {
    position: relative;
    width: 85%;
    margin-left:auto;
    margin-right:auto;
    margin-top: 5px;
    border: 5px solid gray;
    background: #000;
    z-index: 1000;
}

.site-main .sidebar-container {
        background-image: url(http://accelepedia.com/accimages/background02.png)
    height: 0;
    position: absolute;
    top: 40px;
    width: 100%;
    z-index: 1;
}

.site-main .sidebar-inner {
    background-image: url(http://accelepedia.com/accimages/background02.png)
    margin: 0 auto;
    max-width: 1040px;
}

【问题讨论】:

    标签: css wordpress background


    【解决方案1】:

    背景图片不存在:

    http://accelepedia.com/accimages/background02.png

    当我设置以下内容时:

    body {
     background-image: url(https://www.google.com/images/srpr/logo11w.png);
    }
    

    【讨论】:

    • 尝试像这样改变body的背景颜色:body { background-color: green;您在问题中使用的图片在服务器上仍然不存在,我认为您需要上传它或更改网址
    猜你喜欢
    • 2013-06-08
    • 2015-07-04
    • 1970-01-01
    • 1970-01-01
    • 2018-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-23
    相关资源
    最近更新 更多