Cuadro de estiloPropiedad de sombra
Ejemplo
Agregue una sombra de cuadro a un elemento div:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
Definición y uso
La propiedad boxShadow establece o devuelve las sombras paralelas de un elemento de cuadro.
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
Sintaxis
Devuelve la propiedad boxShadow:
object.style.boxShadow
Establezca la propiedad boxShadow:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
Nota: La propiedad boxShadow adjunta una o más sombras paralelas al cuadro. La propiedad es una lista de sombras separadas por comas, cada una especificada por 2 a 4 valores de longitud, un color opcional y una palabra clave insertada opcional. Las longitudes omitidas son 0.
Valores de propiedad
Value | Description |
---|---|
none | Default value. No shadow is displayed |
h-shadow | Required. The position of the horizontal shadow. Negative values are allowed |
v-shadow | Required. The position of the vertical shadow. Negative values are allowed |
blur | Optional. The blur distance |
spread | Optional. The size of shadow |
color | Optional. The color of the shadow. The default value is black. Look at CSS Color Values for a complete list of possible color values. Note: In Safari (on PC) the color parameter is required. If you do not specify the color, the shadow is not displayed at all. |
inset | Optional. Changes the shadow from an outer shadow (outset) to an inner shadow |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | ninguna |
---|---|
Valor de retorno: | Una cadena, que representa la propiedad box-shadow de un elemento |
Versión CSS | CSS3 |
páginas relacionadas
Referencia CSS: propiedad box-shadow
❮ Objeto de estilo