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

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

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

CSS right属性


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

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