九九热线视频精品99-动漫高h纯肉无码视频在线观看-午夜理论无码片在线观看免费-99精品国产在热久久无码-亚洲国产成人乱码

css-父標簽中的子標簽默認位置

2016/12/1 8:46:09   閱讀:1719    發布者:1719

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.a{
width: 100px;
height: 100px;
background: red;
position: relative;
top: 40px;
left: 50px;
padding: 30px;
}
.b{
width: 50px;
height: 50px;
background: bisque;
position: absolute;
}
</style>
</head>
<body>
<div class="a">
<div class="b"></div>
</div>
</body>
</html>

 

 

如果不給b標簽設定top和left。他們會有個默認的值。

top和left會以width和height為基礎進行定位。