bootstrap 使用总结

 

 

 

1.如何设置一行两列?

<div class="container">bootstrap

<div class="row">布局

<div class="col-lg-3 col-md-3 col-xs-3"></div>flex

<div class="col-lg-9 col-md-9 col-xs-9"></div>blog

</div>io

</div>class

下面看结构后台

效果循环

 标签嵌套循环都写在 里面float

 

2.bootstrap中后台动态生成li等标签 没法添加col-lg-4 、col-md-四、col-xs-4等状况使用flex布局

兼容状况im

IE 10+

 红框是居中 justify-content:center

flex布局display flex

flex-warp换行

flex-direction默认是row 从左到右排列

 

 

3.bootstarp 中元素居中对齐

div{

float:none;

display:flex;

margin-left:auto;

margin-right:auto;

}

同时这个div 还添加别的类 好比col-lg-8 

 4.flex居中

实现 

div{

display:flex;

justify-content:center

}

这时候父级元素继续上面的样式  就能够实现居中效果

 结构

 

效果

相关文章
相关标签/搜索