I want to make a vertical line between two div
s. we have hr
for horizontal line but none for vertical line as I know. Is there anyway to make it without using border
?
<style>
#wrapper_1 {
background-color:pink;
height:100px;
float:left;
width: 100px;
}
#wrapper_2 {
background-color:brown;
height:100px;
width: 100px;
float:right;
}
</style>
<div id="wrapper_1">
Creating slideshows PHP
</div>
<div id="wrapper_2">
Creating slideshows with WordPress
</div>
There are two ways to add a horizontal line between two divs. First, put a tag between the two divs, and the second is to place any block-level element such as a div, p, etc, between the two divs and apply a bottom or top border on it. Either way, you can achieve the same task.
You can use <hr>, as it is semantically correct, and then use CSS to convert it to a vertical line. hr.vertical { height:100%; /* you might need some positioning for this to work, see other questions about 100% height */ width:0; border:1px solid black; }
Task #2: Set a linear gradient background for the div element, going from the top left to the bottom right, transitioning from "white" to "green" Install and run react js project...
First, put a tag between the two divs, and the second is to place any block-level element such as a div, p, etc, between the two divs and apply a bottom or top border on it. Either way, you can achieve the same task.
You can also use pseudo elements to make a vertical separator. You don't need an extra div to make a separator just use the pseudo elements and style it according to your needs.
#wrapper_1 {
background-color: pink;
height: 100px;
float: left;
width: 100px;
}
#wrapper_1:after {
content: "";
background-color: #000;
position: absolute;
width: 5px;
height: 100px;
top: 10px;
left: 50%;
display: block;
}
#wrapper_2 {
background-color: brown;
height: 100px;
width: 100px;
float: right;
}
<div id="wrapper_1">
Creating slideshows PHP
</div>
<div id="wrapper_2">
Creating slideshows with WordPress
</div>
PS: Beware of the absolute positioning of the pseudo elements. Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With