Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2004
    Location
    france
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    div and height auto

    can someone tell me why this code is not working !!

    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="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


    Code:
    #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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.

  • #3
    New Coder
    Join Date
    Jul 2004
    Location
    france
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes thats a head-bug in W3C just as vertical-align:middle

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Divitis, spannitis, classitis

    This page suffers and from divitis, and from spannitis, and from classitis!!! (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... 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"?
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •