国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

HTML+CSS和DIV如何實現排版布局

2020-03-24 18:42:00
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了關于HTML+CSS和DIV如何實現排版布局,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下

HTML CSS + div實現排版布局1.網頁可以看成是由一個一個“盒子”組成,如圖:

496770612-5b46ce6edc7b8_articlex[1].jpg

由上圖可以看出,頁面分為上(網站導航)、中、下(版權聲明)三個部分,
中間部分又分為左(商品分類)、中(主要部分)、右,這些版塊就像一個個
的盒子,這些 盒子 中放置著各種內容,頁面就是由這些 盒子 拼湊起來

案例布局分析:

1376923543-5b46cf378eab4_articlex[1].jpg

單列布局案例:代碼如下:
 !doctype html  html  head  meta charset= utf-8 /  title 單列布局 /title  /head  style  body{ margin:0; .box{ width:960px; margin:0 auto; .box .header{ height:120px; border:1px solid #f00; line-height:120px; .box .main{ height:300px; border:1px solid #0f0; line-height:300px; .box .footer{ height:100px; border:1px solid #00f; line-height:100px; text-align:center; /style  body  p >運行結果:

4125081848-5b46d0aebc53f_articlex[1].png

雙列布局案例:代碼如下:
 !doctype html  html  head  meta charset= utf-8 /  title 雙列布局 /title  /head  style  body{ margin:0; .box{ width:80%; margin:0 auto; overflow:hidden; .box .left{ width:30%; height:400px; background-color:#0f0; float:left; .box .right{ width:70%; height:400px; background-color:#f00; float:left; /style  body  p >運行結果如下圖:

644704244-5b46d3b9c6eac_articlex[1].png

三列布局案例:代碼如下:
 !doctype html  html  head  meta charset= utf-8 /  title 三列布局 /title  /head  style  body{ margin:0; .box{ width:960px; margin:0 auto; position:relative; .box .left{ width:200px; height:400px; background-color:#0f0; position:absolute; .box .center{ height:400px; background-color:#00f; margin:0 300px 0 200px; .box .right{ width:300px; height:400px; background-color:#f00; position:absolute; right:0; top:0; /style  body  p >運行結果如下圖:

301091421-5b46d50ad43e5_articlex[1].png

混合布局案例:代碼如下:
 !doctype html  html  head  meta charset= utf-8 /  title 混合布局 /title  /head  style  body{ margin:0; .box{ width:960px; margin:0 auto; .header{ height:120px; background-color:#ddd;  .main{ height:400px; background-color:#f00; position:relative; .main .left{ width:200px; height:400px; position:absolute; left:0; top:0; background-color:#0fccaa; .main .center{ height:400px; margin:0 305px 0 205px; background-color:#123456; .main .right{ width:300px; height:400px; position:absolute; right:0; top:0; background-color:#ff0; .footer{ height:80px; background-color:#ddd; /style  body  p >運行結果如下圖:

2619066118-5b46d5e7b3d8f_articlex[1].png

以上就是本文的全部內容,希望對大家的學習有所幫助,更多相關內容請關注PHP !

相關推薦:

詳解前端在html頁面之間傳遞參數的方法

html用表格布局來實現用戶注冊表單實例

以上就是HTML+CSS和DIV如何實現排版布局的詳細內容,html教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 丰宁| 蕉岭县| 大连市| 新河县| 安阳县| 同德县| 洪湖市| 都兰县| 民权县| 岑巩县| 府谷县| 安龙县| 从江县| 承德市| 宿州市| 铁岭市| 锡林郭勒盟| 盈江县| 黄冈市| 克拉玛依市| 靖江市| 体育| 界首市| 岳池县| 葵青区| 杭锦后旗| 金昌市| 敦化市| 游戏| 津南区| 南开区| 泽库县| 丹巴县| 大悟县| 乌苏市| 江北区| 和平县| 天门市| 高青县| 永济市| 淮阳县|