Border for individual sides in CSS
There are also shortcut properties for individual sides: border-left
, border-right
, border-top
, border-bottom
.
Let's give the block only a left border using the border-left
property:
<div id="elem"></div>
#elem {
width: 300px;
height: 100px;
border-left: 1px solid red;
}
:
Now let's make both the left and right borders at the same time:
<div id="elem"></div>
#elem {
width: 300px;
height: 100px;
border-left: 1px solid red;
border-right: 1px solid red;
}
:
Repeat the page according to this example:
Repeat the page according to this example: