Style borderBottomPropiedad
Objeto Style
Definición y uso
La propiedad borderBottom establece o devuelve, en forma abreviada, tres propiedades independientes del borde inferior.
Mediante esta propiedad, puede establecer/devolver:
- border-bottom-width
- border-bottom-style
- border-bottom-color
Sintaxis
Establecer la propiedad borderBottom:
Object.style.borderBottom="width style color"
Devolver la propiedad borderBottom:
Object.style.borderBottom
Consejo:La propiedad borderBottom no tiene valor predeterminado.
| Parámetros | Descripción |
|---|---|
| width | Establece el ancho del borde inferior. |
| style | Establece el estilo del borde inferior. |
| color | Establece el color del borde inferior. |
Compatibilidad del navegador
![]()
![]()
![]()
![]()
![]()
Todos los navegadores principales admiten la propiedad borderBottom.
Ejemplo
Ejemplo
Cambia el ancho, estilo y color del borde inferior:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial de Ejemplo (example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">Este es un texto.</div>
<br>
<button type="button" onclick="displayResult()">Modificar borde inferior</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial de Ejemplo (example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">Este es un texto.</div>
<br>
<button type="button" onclick="displayResult()">Modificar borde inferior</button>
</body>
</html>
Pruébalo »
Objeto Style Otras extensiones