Latest web development tutorials

HTML DOM propiedad Estilo textDecoration

Estilo de referencia de objetos Objetos de estilo

Definición y Uso

textDecoration conjuntos de propiedades o devuelve uno o más de decoración de texto.

Consejo: Si tiene que modificar uno o más elementos de un tipo predeterminado, especificar una lista separada por espacios.

gramática

Configuración de las propiedades textDecoration:

Object.style.textDecoration="none|underline|overline|line-through|blink|inherit"

textDecoration propiedades para la espalda:

Object.style.textDecoration

描述
none 默认。定义标准的文本。
underline 定义文本下的一条线。
overline 定义文本上的一条线。
line-through 定义穿过文本的一条线。
inherit textDecoration 属性的值从父元素继承。


Soporte para el navegador

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Todos los principales navegadores soportan la propiedad textDecoration.

Nota: Internet Explorer 7 y versiones anteriores no son compatibles con el valor "heredar".IE8 sólo proporciona! DOCTYPE apoyado "hereda". apoyo IE9 "hereda".


Ejemplos

Ejemplos

El texto decorativo:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
    document.getElementById("p1").style.textDecoration="underline overline";
}
</script>
</head>
<body>

<p id="p1">这是一些文本。</p>
<br>
<button type="button" onclick="displayResult()">装饰文本</button>

</body>
</html>

Trate »


Estilo de referencia de objetos Objetos de estilo