HTML Dog
Skip to navigation

CSS Property: right

The right position of a box.

Calculated differently, depending on the position state of a box.

For relative positioned boxes, right defines how far the box is offset from its initial right edge. So a positive value will, in fact, shift the box left.

For absolute (or fixed) position boxes, right defines how far the box is offset from the right edge of its containing block (being the page or a containing positioned box).

Possible Values

ValueNoteExample
[length]100px
[percentage]Calculated in relation to the width of the containing box.50%
autoDefault.
inherit
initial
unset

Example


#tolet {
    position: relative;
    right: 2em;
}

Browser support