
The CSS border-right property is a shorthand property for:
Syntax:
border-right: border-width border-style border-color;
border-right-width – settles the width of an element’s right border.
border-right-style – property settles the style of an element’s right border.
border-right-color – settles the color of an element’s right border.
Example:
<!DOCTYPE html>
<html>
<head>
<style>
h4 {
border-right: 5px dotted #2a9d8f;
}
p {
border-right: 4px solid #e76f51;
}
div {
border-right: double;
}
</style>
</head>
<body>
<h4>A heading with a dotted #2a9d8f right border.</h4>
<p>A paragraph with a solid #e76f51 right border.</p>
<div>A div element with a double right border.</div>
</body>
</html>
Output:
A heading with a dotted #2a9d8f right border.
A paragraph with a solid #e76f51 right border.
Enjoy coding!
Read also: