HTML DOM propiedad Estilo borderTopWidth
Definición y Uso
borderTopWidth conjuntos de propiedades o devuelve el elemento de la anchura de la frontera.
gramática
Configuración de las propiedades borderTopWidth:
Object.style.borderTopWidth="thin|medium|thick|length|inherit"
Volver propiedades borderTopWidth:
Object.style.borderTopWidth
值 | 描述 |
---|---|
thin | 定义细的边框。 |
medium | 默认。定义中等的边框。 |
thick | 定义粗的边框。 |
length | 使用 px、cm 等单位定义边框的宽度。 |
inherit | 上边框的宽度从父元素继承。 |
Soporte para el navegador
Todos los principales navegadores soportan la propiedad borderTopWidth.
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
Cambiar el ancho del borde:
<! DOCTYPE html>
<Html>
<Head>
<Charset Meta = "UTF-8">
<Title> Este tutorial (w3big.com) </ title>
<Style type = "text / css">
# {Ex1
frontera: 1px solid # FF0000;
}
</ Style>
<Script>
displayResult función () {
document.getElementById ( "EX1") style.borderTopWidth = "gruesa" .;
}
</ Script>
</ Head>
<Cuerpo>
<Div id = "EX1"> Esto es un texto. </ Div>
<br>
<Botón type = "button" onclick = "displayResult ()"> Modificar el ancho del borde botón </>
</ Body>
</ Html>
<Html>
<Head>
<Charset Meta = "UTF-8">
<Title> Este tutorial (w3big.com) </ title>
<Style type = "text / css">
# {Ex1
frontera: 1px solid # FF0000;
}
</ Style>
<Script>
displayResult función () {
document.getElementById ( "EX1") style.borderTopWidth = "gruesa" .;
}
</ Script>
</ Head>
<Cuerpo>
<Div id = "EX1"> Esto es un texto. </ Div>
<br>
<Botón type = "button" onclick = "displayResult ()"> Modificar el ancho del borde botón </>
</ Body>
</ Html>
Trate »
Objetos de estilo