map200uk Posted May 3, 2007 Share Posted May 3, 2007 hi, im having trouble with divs, how can i make it so the div takes up 100% of the browser width and height i.e. like a holder for inner divs like if the display was 1024x768 and i want a div contained to take up that amt thanks Link to comment https://forums.phpfreaks.com/topic/49790-divs/ Share on other sites More sharing options...
Copyright Posted May 3, 2007 Share Posted May 3, 2007 You must use height:100% for HTML, BODY and main DIV elemants: *{ margin:0; padding:0; } html, body{ height:100%; } #div1{ height:100%; } ....................... ....................... <div id="div1"> <!-- 100% height div --> </div> Later. Link to comment https://forums.phpfreaks.com/topic/49790-divs/#findComment-244417 Share on other sites More sharing options...
obsidian Posted May 3, 2007 Share Posted May 3, 2007 You must use height:100% for HTML, BODY and main DIV elemants: Even this is not cross-browser compatible. There is no CSS2 attribute that will give 100% across browsers. Do a Google search for "CSS 100% height" and you'll be able to find many, many suggested workarounds, though. Link to comment https://forums.phpfreaks.com/topic/49790-divs/#findComment-244429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.