My background image won’t align between the divs in this code – I have tried clearing them to no avail. Anyone know what’s causing it, or how I can get it to work? CSS in html for convenience.
<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>
Here’s a fiddle: http://jsfiddle.net/FphKk/
Your margins are shifting the divs and therefore their backgrounds causing the stripe misalignment:
No margins: Fiddle here
Added back the inline-block and removed margins in addition to creating a container div with a set width – otherwise the stripes misalign based on window width.
Fiddle here