Vertical line spacer between two divs

前端 未结 7 547
刺人心
刺人心 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

提交回复
热议问题