Propiedad CSS border-top
Ejemplo
Establezca el estilo del borde superior para diferentes elementos:
h1 {
border-top: 5px solid red;
}
h2 {
border-top: 4px dotted blue;
}
div {
border-top: double;
}
Definición y uso
La border-top
propiedad abreviada establece todas las propiedades del borde superior en una declaración.
Las propiedades que se pueden establecer deben estar en el siguiente orden:
- borde-superior-ancho
- estilo de borde superior (obligatorio)
- borde-superior-color
Si se omite border-top-color, el color aplicado será el color del texto.
Valor por defecto: | medio ninguno color |
---|---|
Heredado: | No |
Animable: | si, ver propiedades individuales . Leer sobre animable |
Versión: | CSS1 |
Sintaxis de JavaScript: | objeto .style.borderTop="3px azul punteado" |
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 | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintaxis CSS
border-top: border-width border-style border-color|initial|inherit;
Valores de propiedad
Value | Description |
---|---|
border-top-width | Required. Specifies the width of the top border. Default value is "medium" |
border-top-style | Required. Specifies the style of the top border. Default value is "none" |
border-top-color | Optional. Specifies the color of the top border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
páginas relacionadas
Tutorial de CSS: Borde CSS
Referencia HTML DOM: propiedad borderTop