outline-offset

Baseline Widely available

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

Resumen

La propiedad CSS outline-offset es usada para establecer el espacio entre un contorno outline y el límite o borde de un elemento. Un contorno es una línea que se dibuja al rededor de los elementos, fuera de los límites de su borde.

Valor inicial0
Applies toall elements
Heredableno
Valor calculadoas specified, but with relative lengths converted into absolute lengths
Animation typea length

El espacio será transparente (el elemento padre determinará el fondo).

Sintaxis

css
/* Valores <length> */
outline-offset: 3px;
outline-offset: 0.2em;

/* Valores globales */
outline-offset: inherit;
outline-offset: initial;
outline-offset: unset;

Valores

<length>

La anchura del espacio. Ver <length> para unidades posibles. Valores negativos colocan el borde dentro del elemento.

Sintaxis formal

outline-offset = 
<length>

Ejemplos

css
p {
  outline: dashed thin;
  /* Mueve el contorno 10px lejos del borde */
  outline-offset: 10px;
  border: 1px solid black;
}

Html

html
<p>outline: offset 10px. Border is solid and outline is dashed</p>

El código anterior producirá este efecto:

Otro ejemplo

must be provided

Especificaciones

Specification
CSS Basic User Interface Module Level 4
# outline-offset

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
outline-offset

Legend

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

Full support
Full support
See implementation notes.