猿问

在 如何用css进行布局 的课程的5.2中,footer没有背景颜色是什么原因

footer没有背景颜色显示是什么原因呢?
<!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>
body{ margin:0; padding:0; font-size:30px; font-weight:bold}
div{ text-align:center; line-height:50px}
.top{ height:100px;background:#9cf}
.head,.main{ width:960px;margin:0 auto; 【任务1】}
.head{ height:100px; background:#f90}
.footer{height:50px;background#fcc;margin:0 auto}
.left{ width:220px; height:600px; background:#ccc;float:left; 【任务2】}
.right{ width:740px; height:600px;background:#fcc; float:right}
.r_sub_left{ width:540px; height:600px; background:#9c3; float:left}
.r_sub_right{ width:200px; height:600px; background:#9fc; float:right;【任务3】}
/*.footer{height:50px;margin:0 auto;background:#fcc}*/
</style>
</head>

<body>
<div class="top">
    <div class="head">head</div>
</div>
<div class="main">
    <div class="left">left</div>
    <div class="right">
    <div class="r_sub_left">sub_left
        </div>
        <div class=" r_sub_right">sub_right
        </div>
    </div>
</div>
<div class="footer">footer</div>
</body>
</html>

断桥丶晓风残月
浏览 1319回答 1
1回答
随时随地看视频慕课网APP
我要回答