浮動布局:兩列浮動布局 floatDemo.html 任務1:請補充代碼解決浮動對浮動元素父包含塊#mainbody的影響 任務2:請補充代碼使.left橫向排列,并緊挨著#mainbody左邊緣顯示 任務3:請補充代碼使.right橫向排列,并緊挨著#mainbody右邊緣顯示 任務完成后,最終效果如下:(注意:上面的left、right和mainbody為提示)
浮動布局:兩列浮動布局
floatDemo.html
任務1:請補充代碼解決浮動對浮動元素父包含塊#mainbody的影響
任務2:請補充代碼使.left橫向排列,并緊挨著#mainbody左邊緣顯示
任務3:請補充代碼使.right橫向排列,并緊挨著#mainbody右邊緣顯示
任務完成后,最終效果如下:(注意:上面的left、right和mainbody為提示)
2016-09-30
<!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>無標題文檔</title>
<style type="text/css">
* {
??? margin:0;
?padding:0;
}
#wrap {
?background:#00C;
?margin:0 auto;
?width:960px;
}
#header {
?background:#FF3300;
?width:100%;
}
#mainbody {
???? background:#cf0;
???? width:960px;
??????? overflow:hidden;
}
.left {
?width:800px;
?height:200px;
?background:#000;
?float:left;
}
.right {
width:140px;
height:500px;
background:#690;
float:left;
margin:10px;
}
#footer {
?background:#639;
?width:100%;
}
</style>
</head>
<body>
<div id="wrap">
? <div id="header">頭部</div>
? <div id="mainbody">
??? <div class="left"></div>
??? <div class="right"></div>
? </div>
? <div id="footer">版權部分</div>
</div>
</body>
</html>