Some troubles with div width

Discussion in 'CSS' started by alexa-lol, Feb 1, 2009.

  1. #1
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    		<link rel="stylesheet" type="text/css" href="test.css">
    		<title>Untitled Document</title>
    	</head>
    	<body>
    		<div id="menu">
    			<div id="one"></div>
    			<div id="two"></div>
    			<div id="three"></div>
    		</div>
    	</body>
    </html>
    
    
    
    
    
    
    #menu {
    	border: 2px solid black;
    	width:888px;
    	height:500px;
    	max-width:888px;
    }
    #one {
    	border: 2px solid red;
    	width:250px;
    	height:450px;
    	float:left;
    }
    #two {
    	border: 2px solid green;
    	width:100%;
    	height:450px;
    	float:left;
    }
    #three {
    	border: 2px solid blue;
    	width:250px;
    	height:450px;
    	float:left;
    }
    
    HTML:
    I have the CSS and the HTML code...the problem is...
    How can I make webbrowser understand that the width of the #two is 100% of the space which is left over when applying #one and #three.
    thanks
     
    alexa-lol, Feb 1, 2009 IP
  2. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Simple answer is you can't.

    Maybe set percentages for each column. #one and #three being 20% each leaving #two to be 60% (or slightly less to allow spacing).
     
    webdesigner, Feb 2, 2009 IP