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