2015-12-04 50 views

回答

1

border-left屬性應該解決這個問題。只需將你的行包裹在div中即可。

div { 
 
    border-left: 1px solid black; 
 
    padding-left: 10px; 
 
}
<div> 
 
    <p>Paragraph 1</p> 
 
    <p>Paragraph 2</p> 
 
    <p>Paragraph 3</p> 
 
</div>

1

可以顯示垂直線像下面:

.test { 
 
    display: table-cell; 
 
    padding: 0 5px; 
 
    vertical-align: middle; 
 
} 
 
.test:last-child{ 
 
    border-left:1px solid; 
 
}
<div> 
 
<div class="test"> 
 
    <p>Bar</p> 
 
</div> 
 
<div class="test"> 
 
    <p>Text 1</p> 
 
    <p>Text 2</p> 
 
    <p>Text 3</p> 
 
</div> 
 
</div>

Working Fiddle