【发布时间】:2012-10-05 11:10:13
【问题描述】:
我的背景图像不会在此代码中的 div 之间对齐 - 我尝试清除它们无济于事。任何人都知道是什么原因造成的,或者我怎样才能让它工作?为方便起见,在 html 中添加 CSS。
<div class="header" style="height:200px; background-image: url(bg.png); margin:-8px;">
<img src="logo.png" style="margin-left:auto; margin-right:auto;" />
</div>
<div style="text-align:center;">
<div style="background-image: url(bg.png);background-position:center;
display:inline-block; width:90px; border-bottom-left-radius: 20px;">Div 1</div>
<div style="background-image: url(bg.png);background-position:center;
display:inline-block; width:400px;margin:-4px;">Div 2</div>
<div style="background-image: url(bg.png);background-position:center;
display:inline-block; width:90px;border-bottom-right-radius: 20px;">Div 3</div>
</div>
这是一个小提琴:http://jsfiddle.net/FphKk/
【问题讨论】:
标签: html css image background