border-right
Pruébalo
La propiedad CSS border-right
es un a propiedad rápida para dar valores al border-right-width
(en-US), border-right-style
(en-US) y border-right-color
(en-US). Estas propiedades establecen un borde derecho del elemento.
Como con todas las propiedades rápidas, border-right
siempre establece los valores de todas las propiedades que puede establecer, incluso si no están especificadas. Establece los no especificados a sus valores por defecto. Lo que significa que ...
border-right-style: dotted;
border-right: thick green;
... es en realidad lo mismo que ...
border-right-style: dotted;
border-right: none thick green;
... y el valor de border-right-style
(en-US) dado previamente a border-right
es ignorado. Puesto que el valor por defecto de border-right-style
(en-US) es none
, si no se especifica la parte border-style
el resultado es no establecer un borde.
Sintaxis
border-right: 1px;
border-right: 2px dotted;
border-right: medium dashed green;
Los tres valores de la propiedad rápida pueden ser especificados en cualquier orden, incluso omitiendo uno o dos de ellos.
Valores
<br-width>
- Ver
border-right-width
(en-US). <br-style>
- Ver
border-right-style
(en-US). <color>
- Ver
border-right-color
(en-US).
Formal syntax
border-right =
<line-width> ||
<line-style> ||
<color>
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset
<color> =
<absolute-color-base> |
currentcolor |
<system-color> |
<device-cmyk()>
<absolute-color-base> =
<hex-color> (en-US) |
<named-color> |
transparent |
<rgb()> |
<rgba()> |
<hsl()> |
<hsla()> |
<hwb()> |
<lab()> |
<lch()> |
<oklab()> |
<oklch()> |
<color()>
<device-cmyk()> =
device-cmyk( <cmyk-component>{4} [ / <alpha-value> ]? )
<rgb()> =
rgb( [ <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? ) |
rgb( [ <number> | none ]{3} [ / [ <alpha-value> | none ] ]? )
<hsl()> =
hsl( [ <hue> | none ] [ <percentage> | none ] [ <percentage> | none ] [ / [ <alpha-value> | none ] ]? )
<hwb()> =
hwb( [ <hue> | none ] [ <percentage> | none ] [ <percentage> | none ] [ / [ <alpha-value> | none ] ]? )
<lab()> =
lab( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )
<lch()> =
lch( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )
<oklab()> =
oklab( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )
<oklch()> =
oklch( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )
<color()> =
color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )
<cmyk-component> =
<number> |
<percentage>
<alpha-value> =
<number> |
<percentage>
<hue> =
<number> |
<angle> |
none
<colorspace-params> =
<predefined-rgb-params> |
<xyz-params>
<predefined-rgb-params> =
<predefined-rgb> [ <number> | <percentage> | none ]{3}
<xyz-params> =
<xyz-space> [ <number> | none ]{3}
<predefined-rgb> =
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020
<xyz-space> =
xyz |
xyz-d50 |
xyz-d65
Ejemplo
<div>
Esta caja tiene un borde en el lado derecho.
</div>
div {
border-right: 4px dashed blue;
background-color: gold;
height: 100px;
width: 100px;
font-weight: bold;
text-align: center;
}
Especificaciones
Especificación | Estado | Comentario |
---|---|---|
CSS Backgrounds and Borders Module Level 3 La definición de 'border-right' en esta especificación. |
Candidate Recommendation | No direct changes, though the modification of values for the border-right-color (en-US) do apply to it. |
CSS Level 2 (Revision 1) La definición de 'border-right' en esta especificación. |
Recommendation | No significant changes. |
CSS Level 1 La definición de 'border-right' en esta especificación. |
Recommendation | Initial definition |
Valor inicial | as each of the properties of the shorthand:
|
---|---|
Applies to | all elements. It also applies to ::first-letter . |
Heredable | no |
Valor calculado | as each of the properties of the shorthand:
|
Animation type | as each of the properties of the shorthand: |
Compatibilitidad del navegador
BCD tables only load in the browser