练习(黄冈中学布局)

本例是根据上三例子的原理来做的。用的最多的也就是浮动和定位。

效果图:

代码如下:

<!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">
div{
 width:1000px;
 margin:0 auto;
 background-color:#fff;
}
#nav{
 width:1000px;
 height:30px;
 background:#F9F;
}
#top{
 width:1000px;
 height:70px;
 background:#F6F;
}
#nav1{
 width:1000px;
 height:130px;
 background:#F3F;
}
#content{
 width:1000px;
 height:1480px;
 background:#FFC;
}
#bottom{
 width:1000px;
 height:90px;
 background:#CCC;
}
#c-l{
 width:900px;
 height:1480px;
 background:#0F0;
 float:left;
}
.c-t{
 width:900px;
 height:910px;
 float:left;
}
.c-t-l{
 width:200px;
 height:910px;
 background:#9FF;
 float:left;
}
.c-t-m{
 width:500px;
 height:910px;
 background:#CFF;
 float:left;
}
.c-t-r{
 width:200px;
 height:910px;
 background:#9FF;
 float:right;
}
.c-b{
 width:900px;
 height:570px;
 background:#6F9;
 float:left;
}
#d-r{
 width:100px;
 height:1480px;
 background:#fff;
 float:right;
}
#kuang{
 width:198px;
 height:170px;
 margin:0 auto;
 background:#ccc;
 float:left;
 border:1px solid #666;
}
h3{
 width:198px;
 height:40px;
 background:#0F6;
 float:left;
 margin:0px;
}
p.a{
 width:198px;
 height:130px;
 background:#093;
 float:left;
 margin:0px;
}
#shi{
 width:198px;
 height:60px;
 background:#fff;
 float:left;
 border:1px dotted #000;
}
#dkuang{
 width:198px;
 height:380px;
 margin:0 auto;
 background:#ccc;
 float:left;
 border:1px solid #666;
}
.dbt{
 width:198px;
 height:50px;
 background:#CC0;
 float:left;
}
.dnr{
 width:198px;
 height:330px;
 background:#F69;
 float:left;
}
#m1{
 width:338px;
 height:150px;
 float:left;
 background:#CF0;
}
#m2{
 width:160px;
 height:148px;
 border:1px solid #f00;
 float:left;
 background:#CF0;
}
#m3{
 width:500px;
 height:80px;
 border-bottom:2px solid #F60;
 border-top:2px solid #F60;
 float:left;
 background:#CF0;
}
#m4{
 width:130px;
 height:188px;
 border:1px solid #f60;
 float:left;
 background:#CF0;
}
#m5{
 width:368px;
 height:190px;
 float:left;
 background:#CF0;
}
#m6{
 width:500px;
 height:140px;
 border-top:2px solid #F60;
 float:left;
 background:#CF0;
}
#m7{
 width:500px;
 height:30px;
 border-top:solid 1px #F00;
 border-left:4px solid #f00;
 border-bottom:1px dotted #CCC;
 float:left;
 background:#CF0;
}
#m8{
 width:500px;
 height:180px;
 border:2px solid #F9F;
 float:left;
 background:#CF0;
}
#m9{
 width:500px;
 height:30px;
 border-left:4px solid #f00;
 border-bottom:1px dotted #CCC;
 float:left;
 background:#CF0;
}
#m10{
 width:500px;
 height:60px;
 border:2px solid #f9f;
 float:left;
 background:#CF0;
}
#b{
 width:285px;
 height:280px;
 margin:5px 0 0 12px;
 float:left;
}
.bbt{
 width:285px;
 height:50px;
 background:#FF9;
 float:left;
}
i{
 display:block;
 width:285px;
 height:50px;
 background:#FF6;
 float:left;
 margin-top:10px;
}
p{
 width:285px;
 height:170px;
 background:#fff;
 float:left;
}
</style>
</head>

<body>
<div>
<div id="nav"></div>
<div id="top"></div>
<div id="nav1"></div>
<div id="content">
 <div id="c-l">
     <div class="c-t">
         <div class="c-t-l">
             <div id="kuang">
                 <h3>中学课堂</h3>
                    <p class="a"></p>
                </div>
                <div id="shi">名师寄语</div>
                <div id="kuang">
                 <h3>黄冈之星</h3>
                    <p class="a"></p>
                </div>
                <div id="dkuang">
                    <div class="dbt">
                    学员来信
                    </div>
                    <div class="dnr">
                    </div>
                </div>
                <div id="shi">直播课堂</div>
            </div>
            <div class="c-t-m">
             <div id="m1"></div>
                <div id="m2"></div>
             <div id="m3"></div>
                <div id="m4"></div>
             <div id="m5"></div>
                <div id="m6"></div>
             <div id="m7"></div>
                <div id="m8"></div>
             <div id="m9"></div>
                <div id="m10"></div>
            </div>
            <div class="c-t-r">
             <div id="kuang">
                 <h3>
                    小学课堂
                    </h3>
                    <p class="a"></p>
                </div>
                <div id="shi">新教师版</div>
                <div id="dkuang">
                 <div class="dbt">
                     加盟合作
                    </div>
                    <div class="dnr">
                    </div>
                </div>
                <div id="kuang">
                 <h3>
                   热点调查
                    </h3>
                    <p class="a"></p>
                </div>
               
                <div id="shi">高考冲刺</div>
            </div>
        </div>
        <div class="c-b">
         <div id="b">
             <div class="bbt">互动学习               
                <i>图片</i>
                <p>内容</p>
                </div>

            </div>
            <div id="b">
             <div class="bbt">黄冈密卷
                <i>图片</i>
                <p>内容</p>
                </div>
            </div>
            <div id="b">
             <div class="bbt">学法指导
                <i>图片</i>
                <p>内容</p>
                </div>
            </div>
            <div id="b">
             <div class="bbt">黄冈擂台
                <i>图片</i>
                <p>内容</p>
                </div>
            </div>
            <div id="b">
             <div class="bbt">家长学校
                <i>图片</i>
                <p>内容</p>
                </div>
            </div>
            <div id="b">
             <div class="bbt">新教师版
                <i>图片</i>
                <p>内容</p>
                </div>
            </div>
        </div>
    </div>
    <div id="d-r"></div>
</div>
<div id="bottom"></div>
</div>
</body>
</html>

转载于:https://www.cnblogs.com/93wei/archive/2011/11/07/2238792.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值