bootstrap完美实现5列布局
2018-08-01 本文已影响563人
全栈弄潮儿
自定义五列的 CSS 类
这种方法相对简单的,自定义一套CSS类,尽量和Bootstrap风格保持一致。
.col-xs-5ths, .col-sm-5ths, .col-md-5ths, .col-lg-5ths {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
@media ( min-width : 768px) {
.col-sm-5ths {
width: 20%;
float: left;
}
}
@media ( min-width : 992px) {
.col-md-5ths {
width: 20%;
float: left;
}
}
@media ( min-width : 1200px) {
.col-lg-5ths {
width: 20%;
float: left;
}
}
效果图:
![](https://img.haomeiwen.com/i3100736/ffa76039f9577ddf.png)
更多angular1/2/4/5、ionic1/2/3、react、vue、微信小程序、nodejs等技术文章、视频教程和开源项目,请关注微信公众号——全栈弄潮儿。
![](https://img.haomeiwen.com/i3100736/451ed05b88efbe00.png)