CSS Property: border-left
[this page | pdf | back links]
The CSS (CSS1) border-left property is a shorthand
property combining all the main left border properties.
Valid property values
(other than inherit
or initial) are
defined by the elements of the shorthand and are:
-
border-left-width
-
border-left-style
-
border-left-color
Missing properties are
given their default values.
Default Value:
|
medium none color
|
JavaScript syntax:
|
e.g. object.style.borderLeft="2px solid red"
|
Inherited:
|
No
|
Animatable:
|
Yes
|
In the default value, color
is the CSS colour of the
element.
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
p {width: 200px}
p.x1 {border-left: thin solid red;}
</style>
</head>
<body>
<p>1. Element with default property</p>
<p class="x1">2. Element set using in-file HTML style</p>
<p id="x2">3. Element set using JavaScript</p>
<script>
document.getElementById("x2").style.borderLeft = "thin solid red";
</script>
</body>
</html>
|
FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyBorderLeft() {
var x = document.createElement("DIV"); x.style.borderLeft = "thin solid red"; return (window.getComputedStyle(x, null).borderLeft == "thin solid red");
} |
NAVIGATION LINKS
Contents | Prev | Next | CSS Properties