当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS position属性

CSS
CSS2 Aural
CSS 单位
CSS 颜色
CSS 颜色值
CSS 颜色名称
CSS 编码与组织技巧
CSS 模块化设计思路
CSS完美兼容IE6/IE7/FF的通用方法
CSS @ Ten: 下一个重要的东西

CSS position属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 391 ::
收藏到网摘: n/a

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

登陆 | 还没注册?