Propiedad CSS border-top-with
Ejemplo
Establezca un ancho para el borde superior:
div {border-top-width: thin;}
Más ejemplos de "Pruébelo usted mismo" a continuación.
Definición y uso
La border-top-width
propiedad establece el ancho del borde superior de un elemento.
Nota: Siempre declare la propiedad border-style o
border-top-style antes de la border-top-width
propiedad. Un elemento debe tener bordes antes de poder cambiar el ancho.
Valor por defecto: | medio |
---|---|
Heredado: | No |
Animable: | si. Leer sobre animable |
Versión: | CSS1 |
Sintaxis de JavaScript: | objeto .style.borderTopWidth="5px" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Property | |||||
---|---|---|---|---|---|
border-top-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintaxis CSS
border-top-width: medium|thin|thick|length|initial|inherit;
Valores de propiedad
Value | Description | Play it |
---|---|---|
medium | Specifies a medium top border. This is default | |
thin | Specifies a thin top border | |
thick | Specifies a thick top border | |
length | Allows you to define the thickness of the top border. Read about length units | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Más ejemplos
Ejemplo
Establezca el ancho del borde superior en medio:
div {border-top-width: medium;}
Ejemplo
Establezca el ancho del borde superior en grueso:
div {border-top-width: thick;}
Ejemplo
Establezca el ancho del borde superior en 1px:
div {border-top-width: 1px;}
Ejemplo
Establezca el ancho del borde superior en 15px:
div {border-top-width: 15px;}
páginas relacionadas
Tutorial de CSS: Borde CSS
Referencia CSS: propiedad border-top
Referencia HTML DOM: propiedad borderTopWidth