課程
/前端開發(fā)
/HTML/CSS
/初識HTML(5)+CSS(3)
我box4這么寫也能實現(xiàn)這效果,這么寫可對呢
2025-08-13
源自:初識HTML(5)+CSS(3) 13-9
正在回答
<!DOCTYPE html>
<html>
<head>
? <style>
? ? #box2 {
? ? ? height: 200px;
? ? ? position: relative;
? ? }
? ? #box3 {
? ? #box4 {
? ? ? position: absolute;
? ? ? bottom: 0;
? ? ? width: 200px;
? ? ? height: 40px;
? </style>
</head>
<body>
? <div id="box1">
? ? <div id="box2">相對參照元素進行定位</div>
? </div>
? <h1>下面是任務(wù)部分</h1>
? <div id="box3">
? ? < img src="http://img1.sycdn.imooc.com//541a7d8a00018cf102000200.jpg">
? ? <div id="box4">當(dāng)我還是三年級的學(xué)生時是一個害羞的小女生。</div>
</body>
</html>
舉報
HTML(5)+CSS(3)基礎(chǔ)教程8小時帶領(lǐng)大家步步深入學(xué)習(xí)標(biāo)簽用法和意義
1 回答可不可以這么寫?這么寫是不是對的?
2 回答這樣寫也有同樣效果啊
3 回答這樣寫,實現(xiàn)效果一樣,不知道有什么弊端
3 回答他說可以寫成這樣的,但是這個20px怎么實現(xiàn)呢?
7 回答這樣寫對嗎?一樣可以完成上述效果呀?為什么不行呢?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2025-08-30
<!DOCTYPE html>
<html>
<head>
? <style>
? ? #box2 {
? ? ? height: 200px;
? ? ? position: relative;
? ? }
? ? #box3 {
? ? ? position: relative;
? ? }
? ? #box4 {
? ? ? position: absolute;
? ? ? bottom: 0;
? ? ? width: 200px;
? ? ? height: 40px;
? ? }
? </style>
</head>
<body>
? <div id="box1">
? ? <div id="box2">相對參照元素進行定位</div>
? </div>
? <h1>下面是任務(wù)部分</h1>
? <div id="box3">
? ? < img src="http://img1.sycdn.imooc.com//541a7d8a00018cf102000200.jpg">
? ? <div id="box4">當(dāng)我還是三年級的學(xué)生時是一個害羞的小女生。</div>
? </div>
</body>
</html>