慕課筆記利用css進行布局【混合布局練習】

來源:互聯網
上載者:User

標籤:center   pad   idt   head   float   class   add   image   img   

通過學習div的布局,以一個簡單的內容管理網站的布局為例子,用div+css進行簡單的網頁布局,加深學印象:

<html><head><title>CSS+div布局學習</title><style type="text/css">body{margin:0;padding:0;text-align:center}.head{height:230px;width:960px;background:#f96;margin:0 auto}.cat{height:30px;width:960px;background:#f80;margin:3 auto}.content{height:806px;width:960px;background:#fff;margin:3 auto}.content_left{height:800px;width:760px;background:#fff;float:left}.leftone{height:250px;width:760px;background:#666;}.lefttwo{height:300px;width:760px;background:#fff; margin:3 0 0 0}.leftthree{height:250px;width:760px;background:#999; margin:3 0 0 0}.content_right{height:806px;width:197px;background:#00f;float:right;margin:0 0 0 3}.lefttwo_l{height:300px;width:360px;background:#cc3;float:left}.lefttwo_r{height:300px;width:397px; background:#cc9;float:right;margin:0 0 0 3}.footer{height:30px;width:960px;background:#f80;margin:3 auto}</style></head><body><div class="head">logo位960*230</div><!--頭部logo--><div class="cat">導覽列位置960*30</div><!--導覽列--><div class="content"><div class="content_left"><!--內容左側--><div class="leftone">左側第一欄760*250</div><!--左側第一欄--><div class="lefttwo"><!--左側第二欄--><div class="lefttwo_l">左側第二欄左360*300</div><!--左側第二欄的左側--><div class="lefttwo_r">左側第二欄右197*300</div><!--左側第二欄右側--></div><div class="leftthree">左側第三欄760*250</div><!--左側第三欄--></div><div class="content_right">右側內容位197*806</div><!--內容右側--></div><!--內容--><div class="footer">底部位置960*30</div></body></html>

 效果如下:

 

慕課筆記利用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.