【发布时间】:2011-01-15 14:33:55
【问题描述】:
我正在尝试用图像创建边框,我几乎在那里,但左右 div 不太正确。左边的在 TL 下面,这很糟糕,而右边的由于某种原因漂浮在它下面,使底部的东西全部移位。如果我知道一个可以放样本的好网站,我可以附上一个例子(不想泄露我的网址)
html
<div id="text">
<div class="tl"></div><div class="tm"></div><div class="tr"></div>
<div class="left"></div><div class="content"></div><div class="right"></div>
<div class="bl"></div><div class="bm"></div><div class="br"></div>
</div>
css
.tl {
background: url(corner1.png) no-repeat;
float: left;
height: 56px;
width: 55px
}
.tm {
width: 352px;
height: 59px;
background: url(top.png) repeat-x;
float: left;
}
.tr {
background: url(corner2.png) no-repeat;
float: left;
height: 56px;
width: 55px
}
.content {
padding: 0 5px;
width: 360px;
float: left
}
.bl {
background: url(corner4.png) no-repeat;
float: left;
height: 56px;
width: 55px
}
.bm {
width: 352px;
height: 58px;
background: url(bottom.png) repeat-x;
float: left;
}
.br {
background: url(corner3.png) no-repeat;
float: left;
height: 56px;
width: 55px
}
.left {background: url(left.png) repeat-y; width: 58px; height: 100%}
.right {background: url(right.png) repeat-y; width: 58px; float: left; height: 100%}
【问题讨论】: