博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
网页固定宽度布局
阅读量:5317 次
发布时间:2019-06-14

本文共 3467 字,大约阅读时间需要 11 分钟。

(一个固定宽度div布局)

 

 

<!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">

body{

       font:"幼圆";

       text-align:center;

       font-weight:bold;

       font-size:18px;

      

      

}

#header,#content,#footer{

margin:0 auto;

       padding:0;

       width:800px;

}

#header #top1{

       background-color:#069;

       line-height:6em;}

       #header #top2{

              background-color:#06C;

              line-height:3em;}

 

#leftlist{

       background-color:#099;

       width:250px;

       float:left;

       padding:0px;

       margin:0px;

       }

       #leftlist #list1{

              background-color:#060;

              height:158px;        

              }

              #leftlist #list2{

              background-color:#9CF;

              height:158px;        

              }

              #leftlist #list3{

              background-color:#060;

              height:158px;        

              }

              #leftlist #list4{

              background-color:#9cf;

              height:158px;        

              }

              #leftlist #list5{

              background-color:#060;

              height:157px;        

              }

             

#rightlist{

       width:550px;

       float:left;

       padding:0px;

       margin:0px;}

      

       #rightlist1{

              height:40px;

              background-color:#36F;}

             

              #rightlist2 {

                     height:150px;

                     background:#39c;}

                    

                     #rightlist2 #rl1{

                            width:200px;

                            background:#69f;

                            height:150px;

                            float:left;}

                           

                            #rightlist2 #rl2{

                                   width:350px;

                                   float:left;

                                   background:#6C9;}

                    

                     #rightlist3{

                            height:40px;

                            background:#9C9;

                            width:550px;}

                           

                            #rightlist4{

                                   width:550px;

                                          padding:5px;

                                          margin:0px;}

                                  

                                   #rightlist4 #rg1{

                                          width:250px;

                                          background:#9F0;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg2{

                                          width:250px;

                                          background:#9F3;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg3{

                                          width:250px;

                                          background:#9F6;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg4{

                                          width:250px;

                                          background:#9F9;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg5{

                                          width:250px;

                                          background:#9Fc;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg6{

                                          width:250px;

                                          background:#9fF;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg7{

                                          width:250px;

                                          background:#CFF

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist4 #rg8{

                                          width:250px;

                                          background:#cfc;

                                          height:150px;

                                          float:left;

                                                 padding:5px 10px 10px 10px;

                                          }

                                          #rightlist5{

                                                 width:550px;

                                                 height:100px;

                                                 background:#9CC;

                                                 float:right;

                                                 }

                    

       h3{

              background-color:#09F;}

              h2{

                     background:#69F;}

       #footer{

              background:#ccc;

              width:800px;

              line-height:6em;

             

             

              }

</style>

</head>

 

<body>

<div id="header">

    <div id="top1">Top</div>

    <div id="top2">

    导航

    </div>

</div>

<div id="content">

       <div id="leftlist">

       <div id="list1">

        <h3><strong>通知公告</strong></h3>

        通知公告信息</div>

       <div id="list2">

        <h3> 校内办公系统</h3>

        <p>登陆</p>

        <p> 注册 </p>

       </div>

      <div id="list3">

        <h3>招生栏</h3>

        <p>招生信息</p>

      </div>

      <div id="list4">

        <h3>联系邮箱</h3>

        <p>邮箱地址</p>

      </div>

      <div id="list5">

        <h3>友情链接</h3>

        教育网站

        </div>  

    </div>

   

<div id="rightlist">

<div id="rightlist1">

              新闻中心

        </div>

<div id="rightlist2">

            <div id="rl1">

            图片新闻

            </div>

             <div id="rl2">

             最新报道

            </div>

        </div>

       

<div id="rightlist3">

        分类新闻

    </div>

<div id="rightlist4">

            <div id="rg1">

            <h2>标题1</h2>

            列表内容

            </div>

            <div id="rg2">

            <h2>标题2</h2>

            列表内容

            </div>

            <div id="rg3">

            <h2>标题3</h2>

            列表内容

            </div>

            <div id="rg4">

            <h2>标题4</h2>

            列表内容

            </div>

            <div id="rg5">

            <h2>标题5</h2>

            列表内容

            </div>

            <div id="rg6">

            <h2>标题6</h2>

            列表内容

            </div>

            <div id="rg7">

            <h2>标题7</h2>

            列表内容

            </div>

            <div id="rg8">

            <h2>标题8</h2>

            列表内容

            </div>

        </div>

        <div id="rightlist5">

 

             <p>校园相册展示 </p>

        </div>

</div>

</div>

<div id="footer">

<div id="foot">Footer</div>

</div>

</body>

</html>

 

转载于:https://www.cnblogs.com/liuruyu/archive/2011/11/04/2236118.html

你可能感兴趣的文章
数据持久化时的小bug
查看>>
bzoj2257
查看>>
http://www.bootcss.com/
查看>>
20145308 《网络对抗》 注入shellcode+Return-to-libc攻击 学习总结
查看>>
如何使用USBWebserver在本机快速建立网站测试环境
查看>>
变量提升
查看>>
jquery-jqzoom 插件 用例
查看>>
查看oracle数据库的连接数以及用户
查看>>
三.野指针和free
查看>>
简单【用户输入验证】
查看>>
python tkinter GUI绘制,以及点击更新显示图片
查看>>
Spring面试题
查看>>
C语言栈的实现
查看>>
SRM 628 DIV2
查看>>
2018-2019-2 20165314『网络对抗技术』Exp5:MSF基础应用
查看>>
SecureCRT的使用方法和技巧(详细使用教程)
查看>>
自建数据源(RSO2)、及数据源增强
查看>>
关于View控件中的Context选择
查看>>
2018icpc徐州OnlineA Hard to prepare
查看>>
使用命令创建数据库和表
查看>>