CSS right property
Examples
The right edge of picture element disposed at a position comprising 5 pixels to the left edge of the right:
{
position:absolute;
right:5px;
}
try it"
Attribute definitions and instructions
For static elements for auto; for length values, compared with the corresponding absolute length; for percentage values, the specified value; otherwise auto. For the definition of the relative element, the calculated value of left always equals right.
right attribute specifies the right edge of the element. This attribute defines the positioning element contains the right border and its margin offset between the block right border.
Note: If the value is "static" "position" property, then set the "right" property has no effect.
Defaults: | auto |
---|---|
inherit: | no |
version: | CSS2 |
JavaScript syntax: | object .style.right = "50px" |
Browser Support
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
right | 1.0 | 5.5 | 1.0 | 1.0 | 5.0 |
Property Value
value | description |
---|---|
auto | Defaults. Calculate the right edge of the browser location. |
% | Set as a percentage of the containing element of the meter to the right position. You can use a negative value. |
length | Use px, cm, and other units set up to the right position of the element. You can use a negative value. |
inherit | Provisions should inherit the property value right from the parent element. |
related articles
CSS tutorial: CSS Positioning