Renlok Posted December 18, 2009 Share Posted December 18, 2009 Sorry i wasnt sure to post this in HTML or CSS But what i want is to try and make the effect in the attachment so it looks like its being wrapped around the page. And i cant add the hangover bits with absolute divs because the part above it will change size as its dynamically generated. So i was wondering if its possible to make a div bigger than its container? or if theres a better way [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/ Share on other sites More sharing options...
FaT3oYCG Posted December 18, 2009 Share Posted December 18, 2009 cut the image edges off and put them in the container then the div will simply contain the central part of the image. Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/#findComment-980225 Share on other sites More sharing options...
haku Posted December 20, 2009 Share Posted December 20, 2009 This is what I have done for a similar theme: HTML: <div id="wrapper"> //page contents </div> <div id="header_wrapper"> <div id="header"> // header contents </div> </div> CSS: #wrapper { width:800px; padding-top:300px; // set this to enough space for the entire header margin:0 auto; } #header_wrapper { position:absolute; top:100px; height:200px; (top positioning plus height cannot be more than the top padding left on the body) } #header { width:900px; margin:0 auto; } Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/#findComment-980760 Share on other sites More sharing options...
isedeasy Posted December 21, 2009 Share Posted December 21, 2009 This can easily be achieved by using negative margins (as long as the parent is not set to overflow:hidden;) example here CSS #parent { width:800px; background:red; margin:0 auto; min-height:1000px; /** just for show **/ padding:100px 0 0 0; /** just for show **/ } #child { margin:0 -20px; background:blue; min-height:100px; /** just for show **/ } HTML <div id="parent"> <div id="child"> </div> </div> Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/#findComment-981198 Share on other sites More sharing options...
haku Posted December 21, 2009 Share Posted December 21, 2009 Only problem with negative margins is that they can be a little buggy - i.e. not consistent across browsers. Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/#findComment-981216 Share on other sites More sharing options...
JustLikeIcarus Posted December 31, 2009 Share Posted December 31, 2009 You may get better results using 2 divs as well. Link to comment https://forums.phpfreaks.com/topic/185624-make-a-div-bigger-than-its-container/#findComment-986302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.