propriedade HTML DOM Estilo borderTopWidth
estilo Objects
Definição e Uso
borderTopWidth conjuntos de propriedades ou retorna o elemento sobre a largura da borda.
gramática
Definindo as propriedades borderTopWidth:
Object.style.borderTopWidth="thin|medium|thick|length|inherit"
Propriedades volta borderTopWidth:
Object.style.borderTopWidth
值 | 描述 |
---|---|
thin | 定义细的边框。 |
medium | 默认。定义中等的边框。 |
thick | 定义粗的边框。 |
length | 使用 px、cm 等单位定义边框的宽度。 |
inherit | 上边框的宽度从父元素继承。 |
Suporte a navegadores
Todos os principais navegadores suportam propriedade borderTopWidth.
Nota: IE7 e versões anteriores não suportam o valor "herdar".IE8 só fornece! DOCTYPE suportado "herdar". suporte IE9 "herdar".
Exemplos
Exemplos
Alterar a largura da borda:
<! DOCTYPE html>
<Html>
<Head>
<Charset Meta = "utf-8">
<Title> Este tutorial (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
displayResult function () {
document.getElementById ( "EX1") style.borderTopWidth = "grosso" .;
}
</ Script>
</ Head>
<Body>
<Div id = "EX1"> Este é um texto. </ Div>
<br>
<Button type = "button" onclick = "displayResult ()"> Modificar a largura da borda </ button>
</ Body>
</ Html>
<Html>
<Head>
<Charset Meta = "utf-8">
<Title> Este tutorial (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
displayResult function () {
document.getElementById ( "EX1") style.borderTopWidth = "grosso" .;
}
</ Script>
</ Head>
<Body>
<Div id = "EX1"> Este é um texto. </ Div>
<br>
<Button type = "button" onclick = "displayResult ()"> Modificar a largura da borda </ button>
</ Body>
</ Html>
tente »
estilo Objects