webuser123
04-15-2010, 05:12 PM
Hello,
I have a web page with a fluid center surrounded by the fixed-pixel left and right column. Here is the code of the page :
<!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">
#left {width:200px;position:absolute;left:10px; border: 1px solid #f00;}
#right {width:200px;position:absolute;right:10px; border: 1px solid #000;}
#center {margin:0 210px; border: 1px solid #69f;}
</style>
</head>
<body>
<div id="left"> ... </div>
<div id="right"> ... </div>
<div id="center"> ... </div>
</body>
</html>
The question I have is why the right column drops below if the order of the 'right' and 'center' divs is swapped. If the content within the <body> tags is :
<div id="left"> ... </div>
<div id="center"> ... </div>
<div id="right"> ... </div>
then the right div drops and the page doesn't display correctly. Any idea why the order matters in this case? Thanks!!
I have a web page with a fluid center surrounded by the fixed-pixel left and right column. Here is the code of the page :
<!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">
#left {width:200px;position:absolute;left:10px; border: 1px solid #f00;}
#right {width:200px;position:absolute;right:10px; border: 1px solid #000;}
#center {margin:0 210px; border: 1px solid #69f;}
</style>
</head>
<body>
<div id="left"> ... </div>
<div id="right"> ... </div>
<div id="center"> ... </div>
</body>
</html>
The question I have is why the right column drops below if the order of the 'right' and 'center' divs is swapped. If the content within the <body> tags is :
<div id="left"> ... </div>
<div id="center"> ... </div>
<div id="right"> ... </div>
then the right div drops and the page doesn't display correctly. Any idea why the order matters in this case? Thanks!!