内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

html中如何實(shí)現(xiàn)兩欄布局

這篇文章給大家分享的是有關(guān)html中如何實(shí)現(xiàn)兩欄布局的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。

創(chuàng)新互聯(lián)是一家業(yè)務(wù)范圍包括IDC托管業(yè)務(wù),虛擬空間、主機(jī)租用、主機(jī)托管,四川、重慶、廣東電信服務(wù)器租用,綿陽(yáng)機(jī)房托管,成都網(wǎng)通服務(wù)器托管,成都服務(wù)器租用,業(yè)務(wù)范圍遍及中國(guó)大陸、港澳臺(tái)以及歐美等多個(gè)國(guó)家及地區(qū)的互聯(lián)網(wǎng)數(shù)據(jù)服務(wù)公司。

html中實(shí)現(xiàn)兩欄布局的方法:1、利用float屬性和margin屬性來(lái)實(shí)現(xiàn);2、利用BFC技術(shù)來(lái)實(shí)現(xiàn);3、利用table布局技術(shù)來(lái)實(shí)現(xiàn);4、利用flex彈性布局技術(shù)來(lái)實(shí)現(xiàn);5、利用grid網(wǎng)格布局技術(shù)來(lái)實(shí)現(xiàn)。

本教程操作環(huán)境:windows7系統(tǒng)、CSS3&&HTML5版、Dell G3電腦。

html網(wǎng)頁(yè)中實(shí)現(xiàn)兩欄布局

1、利用float+margin實(shí)現(xiàn)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.left1 {
height: 300px;
background-color: red;
width: 400px;
float: left;
}

.right1 {
width: 400px;
height: 300px;
background-color: green;
margin-left: 400px;
}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html>

2、利用BFC實(shí)現(xiàn)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.left2 {
height: 300px;
background-color: red;
width: 400px;
float: left;
}

.right2 {
height: 300px;
background-color: blue;
overflow: hidden;
}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html>

3、利用table布局

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.parent {
display: table;
width: 100%;
table-layout: fixed;
}

.left3 {
display: table-cell;
height: 300px;
width: 300px;
background-color: pink;
}

.right3 {
display: table-cell;
height: 300px;
background-color: purple;
}
</style>
</head>
<body>
<div>
<div></div>
<div></div>
</div>
</body>
</html>

4、利用flex布局

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.parentf {
display: flex;
flex-direction: row;
justify-content: flex-start;
width: 100%;
}

.left4 {
height: 300px;
width: 300px;
background-color: skyblue;
}

.right4 {
height: 300px;
width: 100%;
background-color: yellowgreen;
}
</style>
</head>
<body>
<div>
<div></div>
<div></div>
</div>
</body>
</html>

5、利用grid布局

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.parent {
height: 400px;
display: grid;
grid-template-columns: 50% 50%;
width: 100%;
}

.left5 {
background-color: skyblue;
}

.right5 {
background-color: pink;
}
</style>
</head>
<body>
<div>
<div></div>
<div></div>
</div>
</body>
</html>

感謝各位的閱讀!關(guān)于“html中如何實(shí)現(xiàn)兩欄布局”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

網(wǎng)頁(yè)名稱(chēng):html中如何實(shí)現(xiàn)兩欄布局
鏈接URL:http://m.rwnh.cn/article6/jdjpog.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、服務(wù)器托管搜索引擎優(yōu)化、自適應(yīng)網(wǎng)站、網(wǎng)站維護(hù)品牌網(wǎng)站設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化
田阳县| 江油市| 财经| 台东市| 周口市| 全椒县| 当阳市| 砀山县| 河池市| 德兴市| 宜宾县| 高唐县| 江口县| 韩城市| 绵竹市| 通山县| 姜堰市| 高青县| 韶关市| 兴义市| 隆德县| 浦东新区| 台北市| 友谊县| 胶州市| 德清县| 会昌县| 胶南市| 阜阳市| 塘沽区| 乐安县| 阳原县| 郎溪县| 镇雄县| 淅川县| 儋州市| 吉林省| 云安县| 溧水县| 清河县| 隆化县|