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

CSS
CSS 介绍
CSS 语法
使用 CSS
CSS 背景
CSS 文字
CSS 字体
CSS 边框
CSS 边距
CSS 填充
CSS 列表
CSS 尺寸
CSS 类别
CSS 定位
CSS 伪类
CSS 伪元素
CSS2 Media类型
CSS 摘要
CSS 实例
CSS2 参考资料
CSS2 打印

CSS position属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 390 ::
收藏到网摘: 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

登陆 | 还没注册?