position 定位
- 属性清单
- position
版本:CSS2 兼容性:IE4+ NS4+ 继承性:无
语法:
- position : static | absolute | fixed | relative
参数:
- static : 无特殊定位,对象遵循HTML定位规则
absolute : 将对象从文档流中拖出,使用left,right,top,bottom等属性进行绝对定位。而其层叠通过z-index属性定义。此时对象不具有边距,但仍有补白和边框
relative : 对象不可层叠,但将依据left,right,top,bottom等属性在正常文档流中偏移位置
fixed : IE5.5及NS6尚不支持此属性
说明:
- 检索对象的定位方式。
对应的脚本特性为position。
示例:
div { position: absolute; bottom: 1in; left: 1in; right: 1in; top: 1in; }
div { position:relative; top:-3px; left:6px; }
效果
小 强 bottom : -20px
小强的属性: