phpPunk Posted December 14, 2006 Share Posted December 14, 2006 [quote]<div style="position: absolute; width: 50%; height: 320px; border: 1px solid black"> <div><img src="" width="340px" height="280px" /></div> <div>Map</div> </div><div style="position: relative; width: 50%; height: 320px; border: 1px solid black; float: right"> Google AdSense </div>[/quote]<b>This is rendered incorrectly as it's not at the bottom???</b>This works but all content after this is displayed as though the DIV's don't exist (underneath them?)What change can I make to correct this issue? Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/ Share on other sites More sharing options...
pr0x Posted December 14, 2006 Share Posted December 14, 2006 [quote author=phpPunk link=topic=118551.msg484517#msg484517 date=1166066387][quote]<div style="position: absolute; width: 50%; height: 320px; border: 1px solid black"> <div><img src="" width="340px" height="280px" /></div> <div>Map</div> </div><div style="position: relative; width: 50%; height: 320px; border: 1px solid black; float: right"> Google AdSense </div>[/quote]<b>This is rendered incorrectly as it's not at the bottom???</b>This works but all content after this is displayed as though the DIV's don't exist (underneath them?)What change can I make to correct this issue?[/quote]change either width percentages to 49%, the border is 1px itself on both div's so that takes 1% of the page, causing an overlap. Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/#findComment-140858 Share on other sites More sharing options...
phpPunk Posted December 14, 2006 Author Share Posted December 14, 2006 hey man thanks for the reply...However, it's not the overlap of the 2 DIV's i meant...but rather the content which comes after the two div's is rendered underneath the DIV'sI'll try what you suggested incase I'm missing something Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/#findComment-140862 Share on other sites More sharing options...
pr0x Posted December 14, 2006 Share Posted December 14, 2006 ah ok, sorry, the reason why the data is being pushed through the div box's is because the box's are set as absolute and relative. So the data just shoves itself to the top. like this: [code]<div style="width: 50%; height: 320px; border: 1px solid black;"> <div><img src="" width="340px" height="280px" /></div> <div>Map</div> </div><div style="width: 50%; height: 320px; border: 1px solid black; position:absolute; top:15px; right:10px;"> <div><img src="" width="340px" height="280px" /></div> <div>Map</div> </div><div> Google AdSense </div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/#findComment-140888 Share on other sites More sharing options...
Daniel0 Posted December 14, 2006 Share Posted December 14, 2006 [code]<div style='width:50%; float:right:'>bla bla bla</div><div>bla bla bla</div>[/code]This should work. Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/#findComment-141139 Share on other sites More sharing options...
monkey_05_06 Posted December 17, 2006 Share Posted December 17, 2006 If you needed 3 colums you could also float one div to the left:[code]<div style = "float: left;">left</div><div>middle</div><div style = "float: right;">right</div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/30588-two-columns-using-divs/#findComment-143173 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.