propriedade HTML DOM Estilo textDecoration
Definição e Uso
textDecoration conjuntos de propriedades ou retorna um ou mais decoração de texto.
Dica: Se você precisar modificar um ou mais elementos de um tipo predeterminado, especificar uma lista separada por espaço.
gramática
Definindo as propriedades textDecoration:
Object.style.textDecoration="none|underline|overline|line-through|blink|inherit"
Propriedades textDecoration Voltar:
Object.style.textDecoration
值 | 描述 |
---|---|
none | 默认。定义标准的文本。 |
underline | 定义文本下的一条线。 |
overline | 定义文本上的一条线。 |
line-through | 定义穿过文本的一条线。 |
inherit | textDecoration 属性的值从父元素继承。 |
Suporte a navegadores
Todos os principais navegadores suportam propriedade textDecoration.
Nota: IE7 e versões anteriores não suportam o valor "herdar".IE8 só fornece! DOCTYPE suportado "herdar". suporte IE9 "herdar".
Exemplos
Exemplos
O 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>
<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>
tente »
estilo Objects