如何更改背景图像大小

时间:2011-07-07 02:38:51

标签: css wordpress

我的网址:http://www.dreambelle.com/ enter image description here 位于滑块下方文本和侧边栏后面的背景图像(白色主边,灰色边条)位置太低。您可以在侧栏内容后面的滑块右侧看到此问题...

问题是我无法弄清楚如何通过css移动背景图像而不移动整个身体内容? enter image description here 背景图像从小条形图(附加)

呈现

2 个答案:

答案 0 :(得分:1)

您需要同时执行这两项操作(将#featured_body设置为较小的高度),并调整#sidebar上的边距

我已经在FF5中测试了以下这些功能:

// Remove 10px from the #featured_body height
#featured_body {
    background: url("images/bgr_board.png") repeat scroll 0 0 transparent;
    float: left;
    height: 356px;
    margin: 0 12px;
    padding: 0;
    width: 618px;
}

// Add 10px to the sidebar top margin
#sidebar {
    float: left;
    height: auto;
    margin: -375px 0 20px;
    padding: 0;
    width: 332px;
}

答案 1 :(得分:0)

这种情况正在发生,因为div#content的{​​{1}}位于background-image下方,而div#featured_body正在推动它。

我有两种选择:

  1. 使div#featured_body的高度更小,以便bg图像与twitter div

  2. 对齐
  3. 将花药wrapper div放在nav下的所有内容周围,然后将background-image添加到其中。 (也就是说,如果你想让bg-img延伸到页面顶部)。

相关问题