...

View Full Version : div and height auto



quentin
06-01-2005, 07:39 AM
can someone tell me why this code is not working !!




<!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="application/xhtml+xml; charset=iso-8859-1"/>

<style type="text/css" media="all">@import "styles/0/style.css";</style>
<style type="text/css" media="all">@import "styles/0/grille.css";</style>
</head>
<body>

<form name="MainForm" method="post" action="Default.aspx" id="MainForm">
<div id="dView"><div class="dRow">
<span class="dLabel">U</span>
<span class="dItem">85</span>
<div style="clear:both;font-size:0px;margin:0px;padding:0px;"></div>
</div>
<div class="dRow">
<span class="dLabel">V</span>
<span class="dItem">86</span>
<div style="clear:both;font-size:0px;margin:0px;padding:0px;"></div>

</div>
<div class="dRow">
<span class="dLabel">W</span>
<span class="dItem">87</span>
<div style="clear:both;font-size:0px;margin:0px;padding:0px;"></div>
</div>
<div style="clear:both;font-size:0px;margin:0px;padding:0px;"></div>
</div>
</form>
</body>
</html>




with this CSS





#dView
{
width:600px;
border:0 solid;
margin:auto;
padding:10px;
background-color:red;
}
.dRow
{
clear:both;
height:auto;
margin:2px;
padding:2px;
width:auto;
text-align:center;
vertical-align:middle;
background-color:white;
}
.dLabel
{

float:left;
width:22%;
text-align:right;
background-color:tan;
height:16px;
color:black;
}

.dItem
{
float:right;
text-indent:2em;
width:76%;
text-align:left;
background-color:green;
height:16px;
color:black;
}




thank you

_Aerospace_Eng_
06-01-2005, 07:59 AM
Well what do you want it to do? Can you at least tell us that? height:auto; doesn't expand each div to take up the height of the page.

quentin
06-01-2005, 09:16 AM
yes thats a head-bug in W3C just as vertical-align:middle

ronaldb66
06-01-2005, 01:23 PM
This page suffers and from divitis, and from spannitis, and from classitis!!! :eek: (and a touch of inline-style-itis, too).
It needs to be put to bed immediately and a doctor should be consulted on short notice.

Seriously: there are a couple of other elements besides div and span... :rolleyes: And, what's the use of the form if there's not a single form-related element in it?
By the way: what do you mean exactly by "not working"?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum