Fixed width floated div with flexible width content

cryder

New Member
I have content in a fixed-width container that I am trying to format like so:\[code\]Description: [button][button]\[/code\]Basically, the description label takes up 50%, the button controls take up 50%. I am doing this by floating the description like so:\[code\]<div style="width: 300px;"> <div style="width: 145px; margin-right: 5px; float: left;">Description:</div> <div>[button][button]</div></div>\[/code\]In the case that there are more buttons than will fit on the right side, rather than having them wrap like this:\[code\]Description: [button][button][button][button]\[/code\]I'd rather have the layout look like:\[code\]Description: [button][button][button][button]\[/code\]So basically, I am having trouble coming up with a simple layout that will keep the description label at 50% width, keep the controls unwrapped and handle both cases above. I am positive I am missing something simple - any pointers?
 
Back
Top