right

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

Sumario

La propiedad right especifica parte de la posición de un elemento (posicionado - es decir, con una posición determinada por código).

Para los elementos con una posición absoluta (aquellos que tienen la propiedad position: absolute ó position: fixed), la propiedad right determina la distancia entre el margen derecho del elemento y el borde derecho de su bloque contenedor.

Sintaxis

right: <length> | <percentage> | auto | inherit ;

Valores

<length>

Una longitud, puede ser un valor negativo, cero, o un valor positivo.

<percentage>

Un porcentaje del ancho del bloque contenedor.

Ejemplos

div {
   position: absolute;
   right: 20px;
   height: 200px;
   border: 1px solid #000;
}

Especificaciones

Specification
CSS Positioned Layout Module Level 3
# insets

Compatibilidad con navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
right
anchor()
Experimental
anchor-size()
Experimental
auto

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

Ver también