Resumen
La propiedad CSS outline-color
establece el color del contorno de un elemento. Un contorno es una línea que se dibuja al rededor de los elementos, fuera de los límites del borde, para resaltar al elemento.
Valor inicial | invert , for browsers supporting it, currentColor for the other |
---|---|
Applies to | all elements |
Heredable | no |
Media | as each of the properties of the shorthand:
|
Valor calculado | For the keyword invert , the computed value is invert . For the color value, if the value is translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. The transparent keyword maps to rgba(0,0,0,0) . |
Animation type | a color |
Canonical order | el orden único no-ambigüo definido por la gramática formal |
Sintaxis
/* Valores clave */
outline-color: invert;
outline-color: red;
/* Valores globales */
outline-color: inherit;
outline-color: initial;
outline-color: unset;
Valores
<color>
- Ver
<color>
para las diferentes palabras clave y notaciones de colores. invert
- Para asegurarse que el contorno es visible, este valor realiza una inversión del color de fondo. Esto hace el contorno más sobresaliente, sin importar el color de fondo. Nótese que los navegadores pueden no soportar este valor. De ser así, solamente considerarán la declaración como inválida
Sintaxis formal
<color> | invertwhere
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>
Ejemplo
HTML
<p class="example">My outline is blue, da ba dee.</p>
CSS
.example {
/* primero debe definirse la propiedad "outline" */
outline: 2px solid;
/* hacer el contorno azul */
outline-color: #0000FF;
}
En vivo:
Especificaciones
Especificación | Estado | Comentarios |
---|---|---|
CSS Basic User Interface Module Level 3 La definición de 'outline-color' en esta especificación. |
Recommendation | Sin cambios |
CSS Transitions La definición de 'outline-color' en esta especificación. |
Working Draft | Define outline-color como propiedad que se puede animar. |
CSS Level 2 (Revision 1) La definición de 'outline-color' en esta especificación. |
Recommendation | Definición inicial |
Compatibilidad de navegadores
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Soporte básico | 1.0 | 1.5 (1.8) [1] | 8.0 | 7.0 | 1.2 (125) |
valor invert |
Sin soporte | Sin soporte [2] | 8.0 | Sin soporte [3] | Sin soporte |
Característica | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Soporte básico | ? | ? | ? | ? | ? |
[1] En versiones previas a Gecko 1.8: -moz-outline-color
.
[2] El soporte fue retirado en la versión 3.0 (1.9).
[3] Soportado en Opera 7 pero el soporte fue retirado en Opera 15 con la adopción del motor Chromium/Blink.