当前位置: 编程技术>WEB前端
Div CSS absolute与relative的区别小结
来源: 互联网 发布时间:2014-10-04
本文导语: 详细讲解两者的关系,需要配合例子,请先看例子: 以下是引用片段: Div + CSS Example, Wayhome's Blog position: absolute; top: 5px; right: 20px; position: absolute; left: 20px; bottom: 10px; ...
详细讲解两者的关系,需要配合例子,请先看例子:
以下是引用片段:
Div + CSS Example, Wayhome's Blog
position: absolute;
top: 5px;
right: 20px;
position: absolute;
left: 20px;
bottom: 10px;
以下是引用片段:
Div + CSS Example, Wayhome's Blog
position: absolute;
top: 5px;
right: 20px;
position: absolute;
left: 20px;
bottom: 10px;
position: absolute;
top: 5px;
left: 5px;
position: relative;
left: 150px;
width: 300px; height: 50px;
1
2
3
4
5
padding: 20px 0 0 20px;
position: absolute;
position: relative;
left: 200px;
width: 300px;
height: 300px;
position: absolute;
top: 20px;
right: 20px;