rpanning
09-19-2003, 01:06 AM
Is it ok to use a <div> inside of a <div>? I'm trying to layout my page with a column on the left but don't know how to do it the way I want without embeding div's. The only way I can think of is:
<div style="height:30px">Header</div>
<div>
<div style="float:left;width:200px;height:100px">Side</div>
<div style="width:100%;height:100px">Body</div>
</div>
<div style="height:20px">Footer</div>
The reason it has to be inside of a div tag is so that I can have a border on the side that will run all the way to the bottom. This way the height of the side has to be the same as the body. Basicly I need it to do the same thing as:
<table>
<tr>
<td height="30" colspan="2">Header</td>
</tr>
<tr>
<td width="200">Side</td>
<td>Body</td>
</tr>
<tr>
<td height="20" colspan="2">Footer</td>
</tr>
</table>
Below is the result I'm trying to get using div's and CSS. Thanks
-----------------------
| |
-----------------------
| | |
| | |
| | |
| | |
| | |
-----------------------
| |
-----------------------
<div style="height:30px">Header</div>
<div>
<div style="float:left;width:200px;height:100px">Side</div>
<div style="width:100%;height:100px">Body</div>
</div>
<div style="height:20px">Footer</div>
The reason it has to be inside of a div tag is so that I can have a border on the side that will run all the way to the bottom. This way the height of the side has to be the same as the body. Basicly I need it to do the same thing as:
<table>
<tr>
<td height="30" colspan="2">Header</td>
</tr>
<tr>
<td width="200">Side</td>
<td>Body</td>
</tr>
<tr>
<td height="20" colspan="2">Footer</td>
</tr>
</table>
Below is the result I'm trying to get using div's and CSS. Thanks
-----------------------
| |
-----------------------
| | |
| | |
| | |
| | |
| | |
-----------------------
| |
-----------------------