View Single Post
  #1 (permalink)  
Old 07-23-2006, 12:18 PM
icb01co2 icb01co2 is offline
WebProWorld Pro
 
Join Date: Feb 2004
Location: England Baby!
Posts: 216
icb01co2 RepRank 0
Default Tableless div problems

Hi All,

I am new to tabless div development and I have a few questions that maybe you can help me with. Ok, first off how do i render a div below a div that has absolute positioning?

For example:

html:

<div class = "top"> /* text */ </div>
<div class = "bottom"> /* bottom text */ </div>

css:

.top
{
position:absolute;
top: 200px;
}


Ok, so I want the bottom div to be rendered underneath the top div. Problem is that it renders it behinf the top div. One way around this would be to set the absolute position of the bottom div to below the top one. Although I will never know how much text is in the top div because the info will come from a dynamic db so i cant give an accurate position to the bottom div.

Second problem I have is when i have two divs side by side like table layout but i want them to both be the same height.

for example if i did this:

<table>
<tr>
<td class = "blue"> This side blue </td>
<td class = "red"> This side red </td>
</tr>
</table>

Ok, so in this situation if i had a load of text in the red td the blue td will also be the same height.

With two divs set at absolute positions next to each other, when the blue side fills up its height will be longer than the red side. Hence it will look lob sided.

I may not be explaining this two well but i hope it makes sense.
Chris.
Reply With Quote