Jump to content

Two columns using DIV's


phpPunk

Recommended Posts

[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?
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.