网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: CSS :: CSS position属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

CSS position属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:2488 :: ::

The position property places an element in a static, relative, absolute or fixed position.
position属性可将元素以static(静态),relative(相对),absolute(绝对)或是fixed(固定)的方式来安置

Inherited: No
继承性:无

Example
举例

h1
{
position:absolute;
left:100px;
top:150px;
}

Possible Values
可能用到的值

Value 描述
static The element is placed in a normal position (according to the normal flow). With the value of "static" we do not use the "left" and "top" properties
元素以正常的形式形式来安置(以正常下垂的形式)。使用了static值我们就无法使用"left"以及"top"属性
relative Moves an element relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position
相对元素原本的位置来对它进行移动,因此"left:20"就会将元素的左定位增加20象素距。
absolute With a value of "absolute" the element can be placed anywhere on a page. The element's position is specified with the "left", "top", "right", and "bottom" properties
使用"absolute"值可以让元素放到页面的任何一个位置。元素的定位完全依赖"left","top","right"以及"bottom"的指定。
fixed  

评论 (0) All