left: 100px;*/
}
.box{
width: 200px;
height: 200px;
background-color: blue;
position: absolute;
right: 0px;
bottom:0px;
}
.box-one{
width: 400px;
height: 400px;
background-color: red;
}
/*.box2{
width: 400px;
height: 400px;
background-color: red;
}*/
</style>
</head>
<body>
<div class="box-father">
<div class="box-one">
</div>
<div class="box">
</div>
</div>
<!--<div class="box2">
</div>-->
</body>
</html>
固定定位(fixed)代码案例:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>固定定位</title>
<style type="text/css">
/*固定定位:
*1、脱离了文档流
*2、原点计算:按浏览器(0,0)来作为基准
*/
*{
padding: 0px;
margin: 0px;
}
body{
height: 1800px;
background-image: url(img/logo.png);
}
.box-father{
width: 500px;
height: 500px;
background-color: yellow;
position: relative;
}
.box{
width: 200px;
height: 200px;
background-color: blue;
/*固定定位*/
position: fixed;
right: 0px;
bottom: 0px;
}
</style>
</head>
<body>
<div class="box-father">
<div class="box">
</div>
</div>
</body>
</html>

文章插图
【CSS:绝对定位、相对定位、固定定位】
推荐阅读
- 淘宝店铺风格定位方案怎么写 店铺风格定位有哪些
- 家里放一物绝对没老鼠灭老鼠的配方 家里放一物绝对没老鼠清凉油
- 当碳酸饮料遇上牛奶,绝对不能这么喝
- 通过CSS注入窃取HTML中的数据
- 开店位置定位怎么弄的 怎么创建自己店铺的定位
- ERD 什么是实体关系图?
- 上廉穴
- 少府穴
- 间使穴
- 承光穴
