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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.