第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

想讓每個div塊之間都有間隔 怎么實現(xiàn)?

<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
<title>浮動模型</title>
<style?type="text/css">
#div3{????
????border:5px?pink?solid;
????width:605px;
????height:20px;
????inline-block;
????background-color:Cyan;
}
?#div1,#div2{border:5px?yellow?solid;
????width:300px;
????height:80px;???
	inline-block;
????background-color:chartreuse;
????float:left;}
</style>
</head>
<body>
<div?id="div3">導(dǎo)航條</div>
?
<div?id="div1">欄目1</div>
<div?id="div2">欄目2</div>

</body>
</html>


正在回答

7 回答

在#div1,#div2中設(shè)置margin-right, margin-top屬性試試。

margin-right:?10px;?
margin-top:?10px;

結(jié)果圖:

http://img1.sycdn.imooc.com//56aa19500001220b06450152.jpg

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Y留過長發(fā)雖未及腰 提問者

非常感謝!是我想要的樣子
2016-01-28 回復(fù) 有任何疑惑可以回復(fù)我~

margin可以設(shè)置周邊距你給的這個例子的話只要加上#div3{margin-bottom:?px}#div1{margin-bottom:?px}即可

0 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>對齊</title>

<style type="text/css">

div{text-align:center;}

div{line-height:8em;}

</style>

</head>

<body>

<div><img src="http://img1.sycdn.imooc.com//52b4113500018cf102000200.jpg" ></div>

<div><img src="http://img1.sycdn.imooc.com//52b4113500018cf102000200.jpg" ></div>

</body>

</html>

這種不知道可以嗎?

0 回復(fù) 有任何疑惑可以回復(fù)我~

<style type="text/css">

#div3{?

margin:10px; ? /*隨便加了10px,是不是你想要的效果*/

? ? border:5px pink solid;

? ? width:605px;

? ? height:20px;

? ? inline-block;

? ? background-color:Cyan;

}

?#div1,#div2{

margin:10px; ? /*隨便加了10px,是不是你想要的效果*/

border:5px yellow solid;

? ? width:300px;

? ? height:80px; ??

? ? inline-block;

? ? background-color:chartreuse;

? ? float:left;}

</style>


0 回復(fù) 有任何疑惑可以回復(fù)我~

在#div1,#div2中設(shè)置margin-right, margin-top屬性試試。

margin-right:?10px;?
margin-top:?10px;

結(jié)果圖:

http://img1.sycdn.imooc.com//56aa19500001220b06450152.jpg

0 回復(fù) 有任何疑惑可以回復(fù)我~

用一個一個大的div包括所有小的div,給大的div設(shè)置一個外邊距(margin)即可。已試驗過。

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Judy_xia

多了兩個字“一個”。
2016-01-28 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>浮動模型</title>

<style type="text/css">

#div3{ ? ?

? ? border:5px pink solid;

? ? width:605px;

? ? height:20px;

? ? inline-block;

? ? background-color:Cyan;

? ? margin-bottom: 10px;

}

?#div1,#div2{border:5px yellow solid;

? ? width:300px;

? ? height:80px; ??

? ? inline-block;

? ? background-color:chartreuse;

? ? float:left;

}

#div1{

? ? margin-right: 10px;

}

</style>

</head>

<body>

<div id="div3">導(dǎo)航條</div>

??

<div id="div1">欄目1</div>

<div id="div2">欄目2</div>

?

</body>

</html>

<!-- 使用margin就可以使用div之間的間隔-->

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

想讓每個div塊之間都有間隔 怎么實現(xiàn)?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號