CSS Property: border-right
[this page | pdf | back links]
The CSS (CSS1) border-right property is a shorthand
property combining all the main right border properties.
Valid property values
(other than inherit
or initial) are
defined by the elements of the shorthand and are:
-
border-right-width
-
border-right-style
-
border-right-color
Missing properties are
given their default values.
Default Value:
|
medium none color
|
JavaScript syntax:
|
e.g. object.style.borderRight="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-right: 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.borderRight = "thin solid red";
</script>
</body>
</html>
|
FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyBorderRight() {
var x = document.createElement("DIV"); x.style.borderRight = "thin solid red"; return (window.getComputedStyle(x, null).borderRight == "thin solid red");
} |
NAVIGATION LINKS
Contents | Prev | Next | CSS Properties