Vertical lines can enhance the visual structure of a webpage, often used to separate content or create distinct sections. You can create a vertical line using HTML and CSS by setting the height, width, and background color of an element like a div. Alternatively, CSS properties like border-left or transform can be used to generate a vertical line, depending on the desired design.
In this article, we will study about vertical line in HTML. We will also study various methods by which we can add a vertical line in our HTML webpage.
Pre-Requisites
In this article, we will study how to create a vertical line in HTML using CSS. In order to better understand it, we must know below topics.
To type a vertical line, use the "Pipe" key located above the Enter key on most keyboards, represented as ( | ).
How does a vertical line look?
A vertical line looks like a straight, upright mark ( | ) representing a mathematical or design element in HTML.
What is the HTML code for the divider line?
In HTML, the divider line is created using the <hr> tag, which stands for horizontal rule and creates a horizontal line.
What is the vertical line symbol called?
The vertical line symbol is called a "pipe" or "vertical bar," denoted as ( | ). It is used in mathematics, programming, and typography.
Can we change the color and thickness of the vertical line?
Yes, we can customize the color and thickness of the vertical line by modifying the CSS properties. With the help of height and color tags we can set the thicknes and color according to us.
Can we extend a vertical line to full height of the page?
We can use CSS properties to make a vertical line extend to the full height of the page. We can set the size of the line. One of the approaches is to set the line height to 100vh; it represents 100% of the viewport height.
Conclusion
In this article we studied about adding a vertical line in our HTML page. We understood three methods of adding a line and studied some examples. For more understanding, you can refer to below-mentioned articles.