restructure html: left element right element center element CSS float left element left float right element right dont float or clear the center div - it will display full width (including the width of the left and right element) so use another content div for a bg color/img.
On 5/21/10, Mark Smith <[email protected]> wrote: > Hello, > > I was wondering in the following example, is it possible to make > divMiddleContainer dynamically expand to fill all available horizontal > space without pushing divOpenContainer and and divCloseContainer onto > another line? > > divOpenContainer and divCloseContainer need fixed widths because they > will contain images. > > Thanks for any suggestions. > > <style> > #divOpenContainer{ > width:50px; > background-color:green; > float:left; > text-align:right; > } > > #divCloseContainer{ > width:50px; > background-color:green; > float:left; > } > > #divMiddleContainer{ > float:left; > background-color:red; > text-align:center; > } > > #divContainer{ > width:100%; > } > > </style> > > <div id="divContainer"> > <div id="divOpenContainer">(</div> > <div id="divMiddleContainer">my content goes here</div> > <div id="divCloseContainer">)</div> > </div> > > -- > -- > You received this because you are subscribed to the "Design the Web with > CSS" at Google groups. > To post: [email protected] > To unsubscribe: [email protected] -- Kevin A. Cameron 206-861-3746 kaceaudio.com -- -- You received this because you are subscribed to the "Design the Web with CSS" at Google groups. To post: [email protected] To unsubscribe: [email protected]
