muzammil
12-15-2010, 02:43 PM
here is the html 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="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
</div>
<div id="leftpart">
</div>
<div id="rightpart">
</div>
<div id="footer">
</div>
</div>
</body>
</html>
And here is the CSS code
@charset "utf-8";
/* CSS Document */
#container
{
width:900px;
margin:0 auto;
}
#header
{
background-color:#960;
height:140px;
width:100%;
}
#leftpart
{
background-color:#06C;
height:500px;
width:50%;
float:left;
}
#rightpart
{
background-color:#060;
height:500px;
width:50%;
float:right;
}
#footer
{
background-color:#F00;
height:120px;
clear:both;
}
Now the Question is When I put this code in the #leftpart
border-right:1px dashed;
the whole page breaks and footer moves down.
Could somebody Explain why???
Please bear with the question as i am very novice.
<!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>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
</div>
<div id="leftpart">
</div>
<div id="rightpart">
</div>
<div id="footer">
</div>
</div>
</body>
</html>
And here is the CSS code
@charset "utf-8";
/* CSS Document */
#container
{
width:900px;
margin:0 auto;
}
#header
{
background-color:#960;
height:140px;
width:100%;
}
#leftpart
{
background-color:#06C;
height:500px;
width:50%;
float:left;
}
#rightpart
{
background-color:#060;
height:500px;
width:50%;
float:right;
}
#footer
{
background-color:#F00;
height:120px;
clear:both;
}
Now the Question is When I put this code in the #leftpart
border-right:1px dashed;
the whole page breaks and footer moves down.
Could somebody Explain why???
Please bear with the question as i am very novice.