问答详情
源自:2-6 编程练习

为什么背景色没有显示?

<!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=gb2312" />

<title>无标题文档</title>

<style type="text/css">

*

{

    padding:0;

margin:0;

}

.mainbox{


    width:960px;


  


    background-color:#CFF;


    overflow:visible;

   

    }


.lefebox{


width:740px;


height:300px;


background-color:#C9F;


float:left;


}    


.rightbox{


width:200px;


height:300px;


background-color:#FCF;


float:right;


}

/*在此定义相应的类选择器,并根据要求设置相关CSS属性*/

.clear{clear:both;

height:0;

overflow:hidden;}



</style>

</head>


<body>

<div class="mainbox">


    <div class="leftbox"></div>


    <div class="rightbox"></div>


    <div class="clear"></div>

</div>


<!--在此添加相应的div标签-->




</body>

</html>


提问者:慕函数5717769 2016-12-05 22:03

个回答

  • qq_紫星幻月_0
    2016-12-05 22:42:39
    已采纳

    leftbox 写成lefebox了