• 57、bootstrap


    1、bootstrap :

    Bootstrap是Twitter开源的基于HTML、CSS、JavaScript的前端框架。

    它是为实现快速开发Web应用程序而设计的一套前端工具包。

    它支持响应式布局,并且在V3版本之后坚持移动设备优先。

    2、bootstrap 下载:

    官方地址:https://getbootstrap.com

    中文地址:http://www.bootcss.com/

    我们使用V3版本的Bootstrap,我们下载的是用于生产环境的Bootstrap。

    3、bootstrap 的目录结构

    bootstrap-3.3.7-dist/
    ├── css  // CSS文件
    │   ├── bootstrap-theme.css  // Bootstrap主题样式文件
    │   ├── bootstrap-theme.css.map
    │   ├── bootstrap-theme.min.css  // 主题相关样式压缩文件
    │   ├── bootstrap-theme.min.css.map
    │   ├── bootstrap.css
    │   ├── bootstrap.css.map
    │   ├── bootstrap.min.css  // 核心CSS样式压缩文件
    │   └── bootstrap.min.css.map
    ├── fonts  // 字体文件
    │   ├── glyphicons-halflings-regular.eot
    │   ├── glyphicons-halflings-regular.svg
    │   ├── glyphicons-halflings-regular.ttf
    │   ├── glyphicons-halflings-regular.woff
    │   └── glyphicons-halflings-regular.woff2
    └── js  // JS文件
        ├── bootstrap.js
        ├── bootstrap.min.js  // 核心JS压缩文件
        └── npm.js

    4、关于标题

    <h1>一级标题36px</h1>
    <h2>二级标题30px</h2>
    <h3>三级标题24px</h3>
    <h4>四级标题18px</h4>
    <h5>五级标题14px</h5>
    <h6>六级标题12px</h6>
    <!--除了使用h标签,Bootstrap内置了相应的全局样式-->
    <!--内联标签应用标题样式-->
    <span class="h1">一级标题36px</span>
    <span class="h2">二级标题30px</span>
    <span class="h3">三级标题24px</span>
    <span class="h4">四级标题18px</span>
    <span class="h5">五级标题14px</span>
    <span class="h6">六级标题12px</span>

    5、文本对齐

    <!--文本对齐-->
    <p class="text-left">文本左对齐</p>
    <p class="text-center">文本居中</p>
    <p class="text-right">文本右对齐</p>

    6、文本大小写

    <!--大小写-->
    <p class="text-lowercase">Lowercased text.</p>
    <p class="text-uppercase">Uppercased text.</p>
    <p class="text-capitalize">Capitalized text.</p>

    7、表格

    Class    描述
    .table-striped    条纹状表格
    .table-bordered    带边框的表格
    .table-hover    鼠标悬停变色的表格
    .table-condensed    紧缩型表格
    .table-responsive    响应式表格

    8、状态类:

    Class描述
    .active 鼠标悬停在行或单元格上时所设置的颜色
    .success 标识成功或积极的动作
    .info 标识普通的提示信息或动作
    .warning 标识警告或需要用户注意
    .danger 标识危险或潜在的带来负面影响的动作

    9、表单

      

        内联表单

        表单状态

        带图标的表单

    10、按钮

    <a class="btn btn-default" href="#" role="button">Link</a>
    <button class="btn btn-default" type="submit">Button</button>
    <input class="btn btn-default" type="button" value="Input">
    <input class="btn btn-default" type="submit" value="Submit">
    <!-- Standard button -->
    <button type="button" class="btn btn-default">(默认样式)Default</button>
    <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
    <button type="button" class="btn btn-primary">(首选项)Primary</button>
    <!-- Indicates a successful or positive action -->
    <button type="button" class="btn btn-success">(成功)Success</button>
    <!-- Contextual button for informational alert messages -->
    <button type="button" class="btn btn-info">(一般信息)Info</button>
    <!-- Indicates caution should be taken with this action -->
    <button type="button" class="btn btn-warning">(警告)Warning</button>
    <!-- Indicates a dangerous or potentially negative action -->
    <button type="button" class="btn btn-danger">(危险)Danger</button>
    <!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
    <button type="button" class="btn btn-link">(链接)Link</button>

    11、图片

    <img src="..." class="img-responsive" alt="Responsive image">

        图片形状

    <img src="..." alt="..." class="img-rounded">
    <img src="..." alt="..." class="img-circle">
    <img src="..." alt="..." class="img-thumbnail">

    12、辅助类

    p class="text-muted">...</p>
    <p class="text-primary">...</p>
    <p class="text-success">...</p>
    <p class="text-info">...</p>
    <p class="text-warning">...</p>
    <p class="text-danger">...</p>

    背景颜色

    <p class="bg-primary">...</p>
    <p class="bg-success">...</p>
    <p class="bg-info">...</p>
    <p class="bg-warning">...</p>
    <p class="bg-danger">...</p>

    关闭按钮

    <button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>

    下拉三角

    <span class="caret"></span>

    快速浮动

    <div class="pull-left">...</div>
    <div class="pull-right">...</div>

    内容块居中

    <div class="center-block">...</div>

    清除浮动

    <!-- Usage as a class -->
    <div class="clearfix">...</div>

    显示与隐藏

    <div class="show">...</div>
    <div class="hidden">...</div>

    13、常用bootstrap组件

  • 相关阅读:
    虚方法、重写方法和抽象方法[转载]
    枚举的默认构造为第一个成员值!
    自定义Attribute例子!
    Python 处理MD5
    php5 反射refection 的用途
    python Sleep休眠函数
    python处理urlencode的两种方式
    python操作mysql进行更新的时候,必须有commit
    Python repr() 或str() 函数
    python抓取网页内容
  • 原文地址:https://www.cnblogs.com/wangyuxing/p/8604416.html
Copyright © 2020-2023  润新知