I have 3 background images that I want to sit side-by-side with the middle one taking up a variable amount of space. I can get the first 2 images to work, but the 3rd breaks on a new line.
Just to be clear, I need the left and right divs to have a fixed width, and the middle div to take up 100% - 50px (25px for the left and right divs in this case).
This answer got my to my current solution.
Current outcome:
HTML:
<div class="wrap">
<div class="left"></div>
<div class="inner">
<p>Text goes here</p>
</div>
<div class="right"></div>
</div>
CSS:
.wrap {
position:relative;
width:100%;
overflow:hidden;
}
.wrap .left {
background:url(../img/banner_small_left.png) 0 0 no-repeat;
width:25px;
height:123px;
float:left;
}
.wrap .inner {
background:url(../img/banner_small_mid.png) 0 0 repeat-x;
height:123px;
overflow:hidden;
}
.wrap .right {
background:url(../img/banner_small_right.png) 0 0 no-repeat;
width:25px;
height:123px;
float:right;
}