我想把3个div连成一行[1] [2] [3]。连续3个div与背景
[1]应该有一个背景图像重复向左
[2]必须居中。其1000像素
[3]应当具有背景图像重复向右
的问题是,[1]显示在顶部[2],[3]以下[2]和背景图像因为[1]和[3]没有出现。如果我只是放一个颜色而不是图像,它会出现(路径是正确的)。
HTML:
<div id="topleft">left</div>
<div id="top" >
<div class="container"/>
<div id="header">Menu</div>
</div>
</div>
<div id="topright">right</div>
CSS:
#topleft {
background-image: url(images/leftrepeat.png);
background-repeat: repeat-x;
float: left;
}
#top .container {
background-image:url(images/center.png);
background-repeat:no-repeat;
min-height:151px;
width:1000px;
float: center;
}
#topright {
background-image: url(images/rightrepeat.png);
float: right;
background-repeat: repeat-x;
}
我设法通过topcontainer获得顶部的权利,将div放在同一行上。另外,通过指定高度,我可以获取背景图片,但不会在没有提及宽度的情况下重复。问题是我需要他们根据需要重复屏幕分辨率,所以我不能提到宽度。任何帮助? – miraco 2013-03-09 07:15:56