ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Bootstrap全局CSS样式按钮和图片以及表格和表单

2022-08-05 14:02:13  阅读:157  来源: 互联网

标签:样式 Bootstrap 表单 按钮 class CSS 图片


Bootstrap全局CSS样式按钮和图片

全局CSS样式:

  按钮:class="btn btn-default"

<body>
    <a class="btn btn-default" href="#">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">
    <br>
    <!-- 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>
</body>

  图片:

    class="img-responsive":图片在任意尺寸都占100%

    <img src="img/banner_1.jpg" class="img-responsive">

    图片的形状:

    <img src="img/banner_1.jpg" class="img-responsive img-rounded">
    <img src="img/banner_1.jpg" class="img-responsive img-circle">
    <img src="img/banner_1.jpg" class="img-responsive img-thumbnail">

  表格:

    添加 .table-bordered 类为表格和其中的每个单元格增加边框。

    通过添加 .table-hover 类可以让 <tbody> 中的每一行对鼠标悬停状态作出响应。

    <table class="table table-bordered table-hover">
        <tr>
            <td>编号</td>
            <td>姓名</td>
            <td>年龄</td>
        </tr>
        <tr>
            <td>001</td>
            <td>张三</td>
            <td>18</td>
        </tr>
        <tr>
            <td>002</td>
            <td>李四</td>
            <td>20</td>
        </tr>
        <tr>
            <td>003</td>
            <td>王五</td>
            <td>28</td>
        </tr>
    </table>

  表单:

    给表单添加class="form-horizontal"

<form class="form-horizontal">
    <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
        <div class="col-sm-10">
            <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
        </div>
    </div>
    <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <div class="checkbox">
                <label>
                    <input type="checkbox"> Remember me
                </label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">Sign in</button>
        </div>
    </div>
</form>

标签:样式,Bootstrap,表单,按钮,class,CSS,图片
来源: https://www.cnblogs.com/xjw12345/p/16553960.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有