Forum Moderators: not2easy

Message Too Old, No Replies

problem with 3 div rows

         

noothernamewasfree

7:36 am on Apr 5, 2004 (gmt 0)

10+ Year Member



i wanted to make a layout like this:

DIV: height: 20 width: 300
DIV: height: auto width: 300
DIV: height: 20 width: 300

so i can enter text or more divs to the middle one and it expands automatically. but now the problem is how to get the bottom div to the right place? it doesn't show properly.

anybody help on this? thx in advance :)
yours

Stratus42

8:53 am on Apr 5, 2004 (gmt 0)

10+ Year Member



Hi!

I think you're looking for clear:both.. for example.. from what I understand you want.. the following seems to work well: (colour added for differentiation purposes)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title</title>

<style>
#wrapper{width:300px;}
#top{height:20px; clear:both; background-color: #f00;}
#bottom{height:20px; clear:both; background-color: #0f0;}
</style>
</head>
<body>
<div id="wrapper">
<div id="top">
<p>this is the top bit this is the top bit this is the top bit this is the top bit</p>
</div>
<p> this is neither the top bit or the bottom bit but the middle bit yadda yadda yaddayadda yadda yaddayadda yadda yadda</p>
<div id="bottom">
<p>This is the bottom bit This is the bottom bit This is the bottom bit This is the bottom bit This is the bottom bit</p>
</div>

</div>
</body>
</html>

noothernamewasfree

9:24 am on Apr 5, 2004 (gmt 0)

10+ Year Member



thx for the fast help
the main problem was the positioning with absolute, because i want to put that layout to the middle of the page.

fixed it now with fixed :)