久久精品视频只有这里-插入女人小穴视频在线观看-日韩欧美精品在线观看免费-综合亚洲欧美日韩综合久久

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

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

<!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為基礎進行定位。