CSS

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
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *