jmag Posted June 1, 2006 Share Posted June 1, 2006 I'm actually just trying stuff out, but it would be cool to be able to do it. Lets say I've got 3 or 4 columns and I want them to float next to eachother, but one or two of them should take the leftover space and just divide it between them.If a site is supposed to be perhaps 900px wide, and then 2 columns are 150px each. Then I want the other columns to just take up what space is left over and fill it without getting on the next line.here's a sample of what I had in mind.CSS:[code] div { border: 1px #000000 solid; padding: 3px; margin: 3px; } #header, #footer { width: 900px; clear: both; } #content { width: 900px; } #menu, #somespace { float: left; width: 200px; background-color: #eeeeee; } #main, #fourth { float: left; width: 200px; background-color: #FF0000; }[/code]HTML:[code] <div name="header" id="header"> header </div> <div name="content" id="content"> <div name="menu" id="menu"> menu </div> <div name="main" id="main"> main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content main content </div> <div name="somespace" id="somespace"> bannerspace </div> <div name="fourth" id="fourth"> fourth column </div> </div> <div name="footer" id="footer"> footer </div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10944-variable-column-div/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.