Css布局系列-綜合應用

來源:互聯網
上載者:User

標籤:

    年前的最後一篇,也不知道明年該何去何從。我從事資訊化系統研發,已有四餘載幹了這麼長時間,感覺什麼都會一點,你讓我去幹我也幹了出來,但是,有時候要感覺自已什麼都不會,唉。我準備明年想去好好做做前端,希望有人願意收留吧!如果你們招人也可M我哦。

廢話不說了進入正題結合前面幾篇所講的,今天給介紹資訊化管理系統的布局,其實我見過資訊化管理系統大多都是這種布局。請看:

 

先對進行分析:

  • 先從上往下看,可以分成上中下三個部份,再從左往右看分成左右二個部份;
  • 從上往下看的三個部份的高度加起來正好等於可視化面高度,沒有用指令碼去計算其高度,所以說樣式的寫得好,會少寫很多指令碼代碼。上下兩個部份的高度是固定,中間部份的高度是自適應;
  • 從左往右看,左邊寬度是固定,右邊寬度是自適應;

綜合上面的分析,其實都是前幾篇介紹過了,只不過我在這裡進行綜合應用一下,讓大家有一個更直觀的感覺,在這裡就不講怎麼去實現。下面貼出實現代碼:

 *{margin: 0;padding: 0; box-sizing: border-box;}  html, body{height: 100%;font-size: 14px;}         .container{height: 100%;} .top, .bottom{width: 100%;height: 60px;background-color: rgb(152,210,250);} .bottom{position: absolute;bottom: 0;height: 30px;line-height: 30px;} .middle{width: 100%;top: 60px;background-color: rgb(250,250,250);position: absolute;bottom: 30px;overflow: auto;border: solid 1px red;}         .left{width: 150px;position: absolute;top: 0;left: 0px;height: 100%;} .center{margin-left: 150px;height: 100%;overflow: hidden;}         .menu{line-height: 40px;list-style: none;} .menu li{padding-left: 10px;border-bottom: solid 1px #ccc;cursor: pointer;} .menu li:hover{background-color: #f60;}
 <div class="container">        <div class="top">            XXX資訊管理系統 原來CSS寫得好,會少寫很多js代碼。        </div>        <div class="middle">            <div class="left">                <ul class="menu" id="menu">                    <li src=‘http://www.cnblogs.com‘>cnblogs</li>                    <li src=‘http://www.baidu.com‘>baidu</li>                    <li src=‘http://www.163.com‘>163</li>                    <li src=‘http://www.sina.com‘>sina</li>                    <li src=‘http://www.mop.com‘>mop</li>                </ul>            </div>            <div class="center">                <iframe src="http://www.cnblogs.com" style="width: 100%; height: 100%;" id="ifrmContent"                    frameborder="0"></iframe>            </div>        </div>        <div class="bottom">            XXX著作權歸XXX所有。        </div>    </div>

 綜合應用樣本源碼

Css布局系列-綜合應用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.