72-bootstrap使用

101 阅读1分钟

bootsrap基础使用

  • 前端组件库,主要是用于快速开发响应式布局,移动端优先

  • 网页:www.bootcss.com

  • 使用步骤:

    • 引入需要的文件

       <link rel="stylesheet" href="./bootstrap/css/bootstrap.min.css">    
       <!-- 注意:jquery必须在bootstrapjs之前引入 -->   
       <script src="./bootstrap/js/jquery-3.5.1.min.js"></script>     
       <script src="./bootstrap/js/bootstrap.bundle.min.js"></script>
      
    • 将需要使用的组件代码复制到页面中使用即可

bootstrap实现响应式

  • 布局容器container
Extra small <576pxSmall ≥576pxMedium ≥768pxLarge ≥992pxExtra large ≥1200px
.container100%540px720px960px1140px
.container-sm100%540px720px960px1140px
.container-md100%100%720px960px1140px
.container-lg100%100%100%960px1140px
.container-xl100%100%100%100%1140px
.container-fluid100%100%100%100%100%
  • 网格系统

Extra small <576pxSmall≥576pxMedium≥768pxLarge≥992pxExtra large≥1200px
container widthNone (auto)540px720px960px1140px
Class prefix.col-.col-sm-.col-md-.col-lg-.col-xl-
# of columns12
Gutter width30px (15px on each side of a column)
NestableYes
Column orderingYes