您也可以將col-bordered
元素display
設置爲flex
,並使用column nowrap
的flex-flow
。在col-bordered
的子元素上設置flex
至1
將強制它們具有相同的高度。
我也設置flex
屬性col-bordered
到0 1 50%
給他們一個相等的寬度。
這裏是例子。
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
body {
margin: 10px;
}
.columns-equal {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.col-bordered {
display: flex;
flex-flow: column nowrap;
flex: 0 1 50%;
}
.col-bordered div {
flex: 1;
}
.row-acc-1 {
background-color: green
}
.row-acc-2 {
background-color: red
}
.col-bordered {
border: 2px solid black
}
<div class="container">
<div class="row columns-equal">
<div class="col-md-6 col-bordered">
<span>
Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem
</span>
</div>
<div class="col-md-6 col-bordered">
<div class="row row-acc-1">
<a>Test</a>
</div>
<div class="row row-acc-2">
<a>Test 2</a>
</div>
</div>
</div>
</div>
謝謝你,這就是我究竟在尋找。 – pwas
太棒了,玩得開心。 ;-) – DavidDomain