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

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

CSS right属性


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

The right property specifies the right edge of an element.
right属性可以设置与其最近一个具有定位设置的父对象右边相关的位置

Note: If the "position" property has a value of "static", the "right" property has no effect.
注意:如果"position"属性的值为"static",那么"right"属性就不会起作用了

Inherited: No
继承性:无

举例

This example sets the right edge of the paragraph 20 px to the left of the right edge of the window:
这个举例会让段落放置在窗口的右边,并向左20px:
p
{
position: absolute;
right: 20px
}

This example sets the right edge of the paragraph 20 px to the right of the right edge of the window:
这个举例会让段落放置在窗口的右边,并向右20px:
p
{
position: absolute;
right: -20px
}

可用值

描述
auto Lets the browser calculate the right position
让浏览器决定右定位。
% Sets the right position in % from the right edge of the window
以窗口的百分比来进行右定位设置
length Sets the right position in px, cm, etc. from the right edge of the window. Negative values are allowed
以px,cm等距离单位来设置右定位。可以使用负数值

评论 (0) All

登陆 | 还没注册?