Estilo textShadow Propiedad
Ejemplo
Añadir sombra a un texto:
document.getElementById("demo").style.textShadow = "5px 5px 1px #ff0000, 10px 10px 1px #0000ff";
Definición y uso
La propiedad textShadow establece o devuelve uno o más efectos de sombra para un texto.
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
textShadow | Yes | 10.0 | Yes | Yes | Yes |
Sintaxis
Devuelve la propiedad textShadow:
object.style.textShadow
Establezca la propiedad textShadow:
object.style.textShadow = "none|h-shadow v-shadow blur color|initial|inherit"
Nota: la propiedad textShadow adjunta una o más sombras al texto. La propiedad es una lista de sombras separadas por comas, cada una especificada por 2 o 3 valores de longitud y un color opcional. Las longitudes omitidas son 0.
Valores de propiedad
Value | Description |
---|---|
none | No shadow is drawn. This is default |
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 |
color | Optional. The color of the shadow. Look at CSS Color Values for a complete list of possible color values |
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 una lista separada por comas de efectos de sombra aplicados al texto del elemento |
Versión CSS | CSS3 |
Más ejemplos
Ejemplo
Devuelve la sombra del texto:
alert(document.getElementById("myP").style.textShadow);
páginas relacionadas
Tutorial CSS: Efectos de texto CSS3
Referencia de CSS: propiedad de sombra de texto
❮ Objeto de estilo