propriedade HTML DOM Estilo wordSpacing
Definição e Uso
wordSpacing propriedade define ou retorna o texto no espaço entre as palavras.
gramática
Definindo as propriedades wordSpacing:
Object.style.wordSpacing="normal|length|inherit"
Propriedades wordSpacing Voltar:
Object.style.wordSpacing
值 | 描述 |
---|---|
normal | 默认。定义单词间的标准空间。 |
length | 使用 px、cm 等单位定义单词间的空间。可使用负值。 |
inherit | wordSpacing 属性的值从父元素继承。 |
Suporte a navegadores
Todos os principais navegadores suportam propriedade wordSpacing.
Nota: IE7 e versões anteriores não suportam o valor "herdar".IE8 só fornece! DOCTYPE suportado "herdar". suporte IE9 "herdar".
Exemplos
Exemplos
Alterar o espaço entre as palavras:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
document.getElementById("p1").style.wordSpacing="50px";
}
</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.wordSpacing="50px";
}
</script>
</head>
<body>
<p id="p1">这 是 一 些 文 本。</p>
<br>
<button type="button" onclick="displayResult()">修改空间</button>
</body>
</html>
tente »
estilo Objects