I have a problem displaying 4 'panels' using the <div> tag and relative positioning where the height of the parent div expands even when the position of the panel should not affect its height because it is horizontally aligned with an existing panel. In short, the yellow area is too big!
Any thoughts?
Thanks in advance.
Any thoughts?
Thanks in advance.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Testing with 4 panels</title>
</head>
<body style="background-color: blue;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:8.5pt;">
<div style="position:relative; left:130px; top:100px; background-color: yellow;">
<div style="position:relative; top:5px; width:80%; margin-left: 14px; margin-right: 5px;">
<p>I'd like to be able to adjust the volume of text in this area of the window
without manually changing the positions of the 4 panels below. Hence I have applied
relative positioning to them. I don't pretend to understand the values
I have placed in the top & left properties but they seem to achieve the
desired result except that the 'parent' div which controls the yellow
background appears to increase to accommodate the height of all 4 panels
(or thereabouts) even though they occur in two horizontally parallel pairs.
I really want to keep the yellow area just big enough vertically to accommodate
this text and the 4 panels. </p>
</div>
<div style="position:relative; top:10px; left:10px; width:260px; height:70px;
background-color:green;"></div>
<div style="position:relative; top:-60px; left:300px; width:260px; height:70px;
background-color:green;"></div>
<div style="position:relative; top:-40px; left:10px; width:260px; height:70px;
background-color:green;"></div>
<div style="position:relative; top:-110px; left:300px; width:260px; height:70px;
background-color:green;"></div>
</div>
</body>
</html>