这是一个屏幕截图:
标题 http://dl.getdropbox.com/u/118004/Screen%20shot%202010-04-13%20at%202.50.49%20PM.png
左边的红色条是我为#personal div 设置的背景,我希望它垂直对齐容器的顶部。
问题是我在#container div 的顶部有绝对定位的#container-top div 的背景。有没有办法将#personal div 向上移动,这样就没有空间了?
HTML
<div id="container">
<div id="container-top"></div>
<div id="personal">
<h1>Jonathan Doe</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqua erat volutpat.</p>
</div> <!-- end #personal -->
</div> <!-- end #container -->
CSS
#container {
background: url(images/bg-mid.png) repeat-y top center;
width: 835px;
margin: 40px auto;
position: relative;
}
#container-top {
background: url(images/bg-top.png) no-repeat top center;
position: absolute;
height: 12px;
width: 835px;
top: -12px;
}
#container-bottom {
background: url(images/bg-bottom.png) no-repeat top center;
position: absolute;
height: 27px;
width: 835px;
bottom: -27px;
}
#personal {
background: url(images/personal-info.png) no-repeat 0px left;
}