Skip to content
Advertisement

HTML CSS Vertical Line with exact height of a div

enter image description here

I’ve got a div element with some content (shown in the picture). I want (for styling purposes) create a vertical line next to it with the exact same height (needs to be responsive so a static “height” value isnt working)

Does anybody have ideas?

Advertisement

Answer

You can attain it using a simple border on the left.

.mytext {
  border-left:3px solid red;
  padding-left:15px;
  }
<div class="mytext">
<h1>Head<h1>
<p>text here</p>
<p>text here</p>
<p>text here</p>
<p>text here</p>
<p>text here</p>
<p>text here</p>
<p>text here</p>
</div>
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement