How do you make a vertical line using HTML?
To make a vertical line, use border-left or border-right property. The height property is used to set the height of border (vertical line) element. Position property is used to set the position of vertical line. Example 1: It creates a vertical line using border-left, height and position property.
There isn't any tag to create a vertical line in HTML.
Adding the Horizontal Line using <hr> tag: The Horizontal Rule tag (<hr>) is used for the purpose of inserting horizontal lines in the HTML document in order to separate sections of the document.
Put a <div>
around the markup where you want the line to appear to next, and use CSS to style it:
.verticalLine { border-left: thick solid #ff0000; }
<div class="verticalLine"> some other content </div>
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