You are here: Reference > CSS > properties > right

right property

Browser support:
Specifies the right coordinate of a positioned element.
A positioned element is an element whose position property is set to relative, absolute or fixed. The value of the right property specifies the right position of the element including the padding, scrollbar, border and the margin.
Use the left, top, right and bottom properties to specify the position for elements. You can set the size of an element with the width and height properties.
JavaScript page for this property: right. You can find other example(s) there.

Possible values:

 One of the following values: 
auto
Default. The right coordinate of the object is in accordance with the default layout of the page.
inherit
Takes the value of this property from the computed style of the parent element.
position in length
The right coordinate of the element in length units. For the supported length units, see the length page.
position in percentage
The right coordinate is the specified percentage of the width of the parent object.
Default: auto.

Example HTML code 1:

This example illustrates the use of the right property:
<head>
    <style>
        .example {
            position: relative;
            right: 60px;
            top: -20px;
        }
    </style>
</head>
<body>
    <img src="bg.jpg">
    <span class="example">over image</span>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content