Blog IT

In this snippet, you can see how to add a vertical line in HTML. But you need to use CSS, as well. Add a vertical line on the left or right side by using the border-left or border-right properties, respectively. See also how to center a vertical line and how to add a vertical line before a text.

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      .verticalLine {
        border-left: 4px solid #f24976;
        height: 200px;
      }
    </style>
  </head>
  <body>
    <div class="verticalLine"></div>
  </body>
</html>