...

View Full Version : Need clever fix: Rendering sibling divs, one defined in px one in %



digitalfallout
01-05-2008, 04:24 AM
I have prepared an example with the explanation of what I am trying to do with it here: http://kc.jorsek.com/test_codelet.php

rams1703
01-05-2008, 01:50 PM
<!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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
width:100%;
}

#redBorder {
border: 2px solid #FF0000;
width:500px;
}

#blueBorder {
border: 2px solid #0099FF;
height:50px;
margin:1px;
}

#greenBorder {
border: 2px solid #339966;
margin:1px;
height:100%;
}
</style>
</head>

<body>
<div id="redBorder">
<div id="blueBorder"></div>
<div id="greenBorder">
This won't work when you specify height for "redBorder" in px
</div>
</div>
</body>
</html>

regards,
rams

Apostropartheid
01-05-2008, 04:16 PM
On green border, why don't you specify a minus margin? I didn't look at source--try reading a menu in Spanish--but that's how I would do it, as it takes off space instead.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum