我有三张图片。左边一个,右边一个,中间一个。 这就是我所拥有的:
<style type="text/css">
img {border:0}
.bl {background: url(images/backer_left.gif) top left no-repeat; height:47px; }
.br {background: url(images/backer_right.gif) top right no-repeat; height:47px;}
.tr {background: url(images/backer_alt.gif) ; margin:0 4px 0 4px; font-size:12px; height:47px;}
.trText { padding:10px; }
.clear { clear:both; }
</style>
<div class="bl">
<div class="br">
<div class="tr">
<div class="trText">lay lay lomm</div>
</div>
</div>
</div>
<div class="clear"> </div>
我看不到左图和右图。只是重复的 backer_alt.gif。我究竟做错了什么? 谢谢
已编辑 这个版本有效:
<style type="text/css">
img {border:0}
.bl {background: url(images/backer_left.gif) top left no-repeat; height:47px; }
.br {background: url(images/backer_right.gif) top right no-repeat; height:47px;}
.tr {background: url(images/backer_alt.gif) ; margin:0 4px 0 4px; font-size:12px; height:47px;}
.trText { padding:10px; }
.clear { clear:both; }
</style>
<div class="bl">
<div class="br">
<div class="tr">
<div class="trText">lay lay lomm</div>
</div>
</div>
</div>
<div class="clear"> </div>
最佳答案
尝试将 .tr
的 margin
设置为 10px 而不是 padding
。您可能还需要将 .br
上的 background-position
设置为 top right
,以便它出现在正确的位置。
关于css圆 Angular ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6682387/