I'm still not 100% sure what you want.
You say it still accounts for the div, even when hidden - this is true. the div is still there, you just can't see it. So i changed 'visibility' property to the 'display' property, which makes the elememnt actually contract so it takes no space! I also added a javascript function instead of doing all the code inseide the element as it looks a lot clearer.
The second div is still on the right though. I can sort that as well if you want.
I think it's just a case of putting both of the divs in a centered div.
Code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>title</title>
<style type="text/css">
body {
width:800px;
margin-left: auto;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
background-color:#000000;
}
#Container {
clear:both;
width: 524px;
padding-bottom: 10px;
padding-top: 5px;
padding-left: 0px;
padding-right: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 9px;
color: #000000;
float: left;
}
#box {
width: 524px;
padding-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
margin-right: 18px;
background-color: #c4dbec;
border: 1px solid #999999;
float: left;
}
#area {
width: 764px;
padding-bottom: 10px;
padding-left: 18px;
padding-right: 18px;
padding-top: 10px;
background-color: #FFFFFF;
}
</style>
<script type="text/javascript">
function toggleVisibility(call, elem)//etc
{
var temp_elem = document.getElementById(elem);
if(call.options[call.selectedIndex].value == elem)
{
temp_elem.style.display = "block";
}
else
{
temp_elem.style.display = "none";
}
temp_elem = null;
}
</script>
</head>
<body>
<div id="area"><form method="post" action="">
<div id="Container">
<select name="select" onchange="toggleVisibility(this, 'dwrap'); toggleVisibility(this, 'bwrap')">
<option value="dwrap">Description</option>
<option value="bwrap">Description With Bullets</option>
</select> Select your Description type. Either 100 words or 65 words and 4 bullet points</div>
<div id="dwrap" style="display:block width:auto; height:auto; clear:both; z-index:1; float:left;">
<div id="box">Description<br />
<textarea name="textarea1" cols="63" rows="10" id="textarea1"></textarea>
</div>
</div>
<div id="bwrap" style="display:none; width:auto; height:auto; clear:both; z-index:1; float:left;">
<div id="box">Description<br />
<textarea name="textarea2" cols="63" rows="10" id="textarea2"></textarea>
</div>
<div id="b">Bullet Points<br />
<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>1.
<input name="1" type="text" id="1" size="32" /></td>
<td>2.
<input name="2" type="text" id="2" size="32" /></td>
</tr>
<tr>
<td>3.
<input name="3" type="text" id="3" size="32" /></td>
<td>4.
<input name="4" type="text" id="4" size="32" /></td>
</tr>
</table>
</div>
</div>
</form>
</div>
</body>
</html>
Bookmarks