abstrak:<!DOCTYLE html><html><head><meta charset="utf-8"><title>絕對(duì)定位和相對(duì)定位,導(dǎo)航</title><style>.b{background:pink;width:600px;height:400px;position:relative; to
<!DOCTYLE html>
<html>
<head>
<meta charset="utf-8">
<title>絕對(duì)定位和相對(duì)定位,導(dǎo)航</title>
<style>
.b{background:pink;width:600px;height:400px;position:relative; top:10px;left:20px;text-align:center;color:white;font-size:20px;line-height:50px;}
.b p{background:green;text-align:left;}
.a{background:green;width:300px;height:200px;color:white;font-size:12px;text-align:left;position:absolute; bottom:0px;right:0px;line-height:40px;}
.a p{background:pink;}
</style>
</head>
<body>
<div class="b"><p>我是相對(duì)定位,relative,top,left值,absolute,你有嗎?估計(jì)你也有,誰(shuí)讓你是我兒子呢?</p>
<div class="a">
<p>我是絕對(duì)定位,我要找個(gè)爸爸,他還要有relative,否則我就離開(kāi)他再找爸爸</p>
</div>
</div>
</body>
</html>
Guru membetulkan:韋小寶Masa pembetulan:2019-02-01 09:52:03
Rumusan guru:寫的很不錯(cuò) 有點(diǎn)意思 css中唯一比較復(fù)雜的也就是定位了 一定要多練習(xí)哦!