Style borderLeftWidthPropiedad
Objeto Style
Definición y uso
La propiedad borderLeftWidth establece o devuelve el ancho del borde izquierdo de un elemento.
Sintaxis
Establecer la propiedad borderLeftWidth:
Object.style.borderLeftWidth="thin|medium|thick|length|inherit"
Devolver la propiedad borderLeftWidth:
Object.style.borderLeftWidth
| Valor | Descripción |
|---|---|
| thin | Define un borde delgado. |
| medium | Predeterminado. Define un borde mediano. |
| thick | Define un borde grueso. |
| length | Define el ancho del borde usando unidades como px, cm, etc. |
| inherit | El ancho del borde izquierdo se hereda del elemento padre. |
Compatibilidad con navegadores
![]()
![]()
![]()
![]()
![]()
Todos los navegadores principales admiten la propiedad borderLeftWidth.
Nota:IE7 y versiones anteriores no admiten el valor "inherit". IE8 solo admite "inherit" si se ha especificado un !DOCTYPE. IE9 admite "inherit".
Ejemplo
Ejemplo
Cambiar el ancho del borde izquierdo:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial de novatos (example.com)</title>
<style type="text/css">
#ex1{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderLeftWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">Esto es algo de texto.</div>
<br>
<button type="button" onclick="displayResult()">Modificar el ancho del borde izquierdo</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial de novatos (example.com)</title>
<style type="text/css">
#ex1{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderLeftWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">Esto es algo de texto.</div>
<br>
<button type="button" onclick="displayResult()">Modificar el ancho del borde izquierdo</button>
</body>
</html>
Pruébalo »
Objeto Style Otras extensiones