---- position

position 固定的属性,是全局的。和DIV层次无关。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div style="background-color: aqua">标记1</div>
<div style="background-color: brown ;position: fixed;
bottom: 0;right: 0" >标记2</div>
</body>
</html>

结果如下:

<html> ---- position

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div style="background-color: aqua ;height: 100px">
标记1
<div style="background-color: brown ;"
>标记2</div>
</div>
</body>
</html>

<html> ---- position

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div style="background-color: aqua ;height: 100px">
标记1
<div style="background-color: brown ;position: fixed;right: 0;bottom: 0;"
>标记2</div>
</div>
</body>
</html>
上一篇:【机器学习实战学习笔记(1-1)】k-近邻算法原理及python实现


下一篇:转: c++继承中的内存布局