Latest web development tutorials

propriété HTML DOM style textDecoration

Style de Object Reference style Objets

Définition et utilisation

ensembles de propriétés textDecoration ou retourne un ou plusieurs textes de décoration.

Astuce: Si vous avez besoin de modifier un ou plusieurs éléments d'un type prédéterminé, spécifier une liste séparée par des espaces.

grammaire

Définition des propriétés de textDecoration:

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

Retour propriétés textDecoration:

Object.style.textDecoration

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


support du navigateur

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Tous les principaux navigateurs prennent en charge la propriété de textDecoration.

Note: IE7 et les versions antérieures ne supportent pas la valeur "inherit".IE8 ne fournit DOCTYPE! Supporté "inherit". soutien IE9 "inherit".


Exemples

Exemples

texte décoratif:

<!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>

Essayez »


Style de Object Reference style Objets