问答详情
源自: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;height=300px;background-color:#CFF;overflow:visible;}

.leftBox{width=740px;height=300px;background-color:#C9F;float:left;}

.rightBox{width=210px;height=300px;background-color:#FCF;float:right;}

.clear

{

    clear:both;

height:0;/*解决IE6下有高度的问题*/

    overflow:hidden;}

</style>

</head>


<body>



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

<div class="mainBox">

    <div class="leftBox"></div>

    <div class="rightBox"></div>

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

</div>



</body>

</html>



提问者:慕粉3809774 2016-09-25 16:24

个回答

  • miku61
    2016-09-25 16:51:38
    已采纳

    你的css代码里面,width和height写法错了。应该是冒号,不是等号。例如   width:960px;height:300px