Vertical line spacer between two divs

前端 未结 7 531
刺人心
刺人心 2021-02-04 02:58

So I have two divs. One left div with navigation links and one right div that populates with content depending on what link you click on the left. I would like to have a verti

相关标签:
7条回答
  • 2021-02-04 03:59

    The way I do this is to put the elements into a container div with overflow hidden. You then apply a left border to all repeating div's. Then, on all floating child elements you set the css properties: padding-bottom:2000px; margin-bottom-2000px;

    Example:

    CSS

    div.vert-line{overflow:hidden}
    div.vert-line>div+div{border-left:#color;}
    div.vert-line>div{width:200px; float:left; padding-bottom:2000px; margin-bottom:-2000px;}
    

    HTML

    <div class="vert-line>
      <div>Left Side</div>
      <div>Right Side</div>
    </div>
    

    Hope this helps!

    0 讨论(0)
提交回复
热议问题