Bootstrap栅格系统简单实现代码

Bootstrap栅格系统的简单介绍,供大家参考,具体内容如下

栅格系统:总共分为12个,超过12个会自动换行,可嵌套,嵌套也不可超过12个,且不会超过父栏

代码:

<html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE-edge"> <meta content="width=device-width,initial-scale=1"> <title>Bootstrap 101 Template</title> <link href="https://cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"> <link href="https://cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap.min.css"> <style> div{ border:1px solid #cccccc; } </style> </head> <body> <!-- 栅格系统 --> <div> <div> <div>A</div> <div>B</div> <div>C</div> </div> </div> <!-- 中等屏幕与超小屏幕的处理 --> <div> <div> <div>.col-xs-12 .col-md-8</div> <div>.col-xs-6 .col-md-4</div> </div> </div> <!-- 偏移:offset --> <div> <div> <div>.col-md-4</div> <div>.col-md-4 .col-md-offset-4</div> </div> <div> <div>.col-md-3 .col-md-offset-3</div> <div>.col-md-3 .col-md-offset-3</div> </div> <div> <div>.col-md-6 .col-md-offset-3</div> </div> </div> <!-- 嵌套 --> <div> <div> <div> Level 1 <div> <div> Level 2 </div> <div> Level 2 </div> </div> </div> </div> </div> <!-- pull:从右向左 push:从左向右 --> <div> <div> <div>.col-md-9 .col-md-push-3</div> <div>.col-md-9 .col-md-pull-9</div> </div> <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.1/js/npm.js"></script> </body> </html>

结果:

Bootstrap栅格系统简单实现代码

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwzysj.html