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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么margin-top不能用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

<title>無標(biāo)題文檔</title>

<style>

*{margin:0;padding:0}

#box1{width:200px;height:200px;background:red;}

#box2{width:100px;height:100px;background:yellow;margin-top:50px}

</style>

</head>


<body>

<div id="box1">

? ? ? <div id="box2">fsbhsrndtyjntm

? ? ? ?</div>

</div>

</body>

</html>


正在回答

3 回答

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

<title>無標(biāo)題文檔</title>

<style>

*{margin:0;padding:0}

#box1{width:200px;height:200px;background:red;position:relative;}

#box2{width:100px;height:100px;background:yellow;margin-top:50px;position:absolute;}

/*你是要這種效果嗎?*/

</style>

</head>


<body>

<div id="box1">

? ? ? <div id="box2">fsbhsrndtyjntm

? ? ? ?</div>

</div>

</body>

</html>


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

狂四郎 提問者

不是,我是想里面的盒子距大盒子頂部50px;
2017-01-04 回復(fù) 有任何疑惑可以回復(fù)我~
#2

狂四郎 提問者

非常感謝!
2017-01-05 回復(fù) 有任何疑惑可以回復(fù)我~

這段代碼你測(cè)試一下,就是你說的那種效果啊,box2現(xiàn)在距離box1頂部50px,你看下吧

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

狂四郎 提問者

我是想問為什么定位之后才可以,其實(shí)加一個(gè)浮動(dòng)也行,我就想知道為什么我這樣直接寫不行?
2017-01-04 回復(fù) 有任何疑惑可以回復(fù)我~

應(yīng)該加一個(gè)position:absolute 在box2的格式中

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

qq_明明_10

希望可以幫助到你
2017-01-04 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么margin-top不能用

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

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

幫助反饋 APP下載

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

公眾號(hào)

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