跳到内容(1) Cob.com.cn

CodeCoke

CSS2.0中文手册·position

您的位置:首页>>教程>>CSS2.0中文手册>>position 定位

position 定位

版本:CSS2  兼容性:IE4+ NS4+ 继承性:无

语法:

参数:

  1. static :  无特殊定位,对象遵循HTML定位规则
    absolute :  将对象从文档流中拖出,使用leftrighttopbottom等属性进行绝对定位。而其层叠通过z-index属性定义。此时对象不具有边距,但仍有补白边框
    relative :  对象不可层叠,但将依据leftrighttopbottom等属性在正常文档流中偏移位置
    fixed :  IE5.5及NS6尚不支持此属性

说明:

示例:

div { position: absolute; bottom: 1in; left: 1in; right: 1in; top: 1in; }
div { position:relative; top:-3px; left:6px; }

效果

小 强 bottom : -20px
小强的属性: