不知怎的,我无法得出如何完成我的代码,我格式化为一个列表,需要格式化为网格,这是由javascript切换。
<div class="list"> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Right is next DIV</div> <div class="col-lg-6 col-md-6 col-sm-5 col-xs-12">Right is next DIV</div> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">I am the last DIV</div> </div> </div>
列表的CSS代码。所有其他CSS都是由引导引用的
.styled_view div.list { padding: 0; width: 100%; }
<div class="grid"> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Under me should be a DIV</div> <div class="col-lg-6 col-md-6 col-sm-5 col-xs-12">Under me should be a DIV</div> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">I am the last DIV</div> </div> </div>
网格的CSS
.styled_view div.grid { display: inline-block; overflow: hidden; vertical-align: top; width: 19.4%; }
画廊的每个部分的19.4%保持下一个DIVs。它不会推到新的一行。我该怎么解决?
解决方法
做一个div div
喜欢这个
<div class="grid"> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Under me should be a DIV</div> <div class="col-lg-6 col-md-6 col-sm-5 col-xs-12">Under me should be a DIV</div> </div> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">I am the last DIV</div> </div> </div>