How to Draw a Vertical Line in HTML
In this tutorial, we are going to see how to draw a vertical line in HTML. You can use border property on <span> element in combination with another CSS property, such as display and height property, to create vertical lines in HTML format.
Source Code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Draw a Vertical Line in HTML</title> <style> .vertical-line{ border-left: 2px solid #000; display: inline-block; height: 130px; margin: 0 20px; } </style> </head> <body> Lorem ipsum <span class="vertical-line"></span> Lorem ipsum </body> </html>
Result |
---|
Lorem ipsum Lorem ipsum |