Estilo borderTopStyle Propiedad
Ejemplo
Agregue un borde superior "sólido" a un elemento <div>:
document.getElementById("myDiv").style.borderTopStyle = "solid";
Definición y uso
La propiedad borderTopStyle establece o devuelve el estilo del borde superior de un elemento.
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
borderTopStyle | Yes | Yes | Yes | Yes | Yes |
Sintaxis
Devuelve la propiedad borderTopStyle:
object.style.borderTopStyle
Establezca la propiedad borderTopStyle:
object.style.borderTopStyle = value
|initial|inherit
Valores de propiedad
Value | Description |
---|---|
none | Defines no border. This is default |
hidden | Same as "none", except in border conflict resolution for table elements |
dotted | Defines a dotted border |
dashed | Defines a dashed border |
solid | Defines a solid border |
double | Defines two borders. The width of the two borders are the same as the border-width value |
groove | Defines a 3D grooved border. The effect depends on the border-color value |
ridge | Defines a 3D ridged border. The effect depends on the border-color value |
inset | Defines a 3D inset border. The effect depends on the border-color value |
outset | Defines a 3D outset border. The effect depends on the border-color value |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | ninguna |
---|---|
Valor devuelto: | Una cadena, que representa el estilo del borde superior de un elemento. |
Versión CSS | CSS1 |
Más ejemplos
Ejemplo
Cambie el estilo del borde superior de un elemento <div> a "punteado":
document.getElementById("myDiv").style.borderTopStyle = "dotted";
Ejemplo
Devuelve el estilo del borde superior de un elemento <div>:
alert(document.getElementById("myDiv").style.borderTopStyle);
Ejemplo
Una demostración de todos los diferentes valores:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderTopStyle = listValue;
páginas relacionadas
Tutorial de CSS: Borde CSS
Referencia de CSS: propiedad de estilo de borde superior
Referencia HTML DOM: propiedad de borde
❮ Objeto de estilo