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

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

CSS right属性


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

登陆 | 还没注册?