Bootstrap按钮和按钮组样式

2022-03-22  本文已影响0人  马佳乐

按钮样式

功能
class="btn" 默认的按钮
class="btn-primary" —组按钮中的初始状态
class="btn-success" 一个成功或积极的动作
class="btn-info" 警告信息的上下文按钮
class="btn-warning" 谨慎采取的动作
class="btn-danger" 潜在危险动作
class="btn-link" 看起来像一个连接,但保持按钮的行为

代码练习:

        <button class="btn btn-primary">按钮</button>
        <button class="btn btn-success">按钮</button>
        <a href="#" class="btn btn-info">超链接</a>
        <input type="button" class="btn btn-danger" value="input按钮" />
        <button class="btn btn-outline-info">按钮</button>
        <button class="btn btn-info btn-lg">大按钮</button>
        <button class="btn btn-info btn-sm">小按钮</button>
        <br />
        <button class="btn btn-primary btn-block">block按钮</button>
        <button class="btn btn-primary" disabled="disabled">按钮</button>
        <a href="#" class="btn btn-info disabled">超链接</a>
        <button class="btn btn-success" data-toggle="button">按钮</button>
        <button class="btn btn-success active">按钮</button>

按钮组样式

        <div class="btn-group btn-group-toggle" data-toggle="button">
            <label class="btn btn-warning active ">
                <input type="checkbox" checked="checked" />java
            </label>
            <label class="btn btn-warning">
                <input type="checkbox" />Python
            </label>
            <label class="btn btn-warning">
                <input type="checkbox" />JavaScript
            </label>
        </div>
        <br /><br />
        <div class="btn-group btn-group-toggle" data-toggle="buttons">
            <label class="btn btn-warning  ">
                <input type="radio"  name="aa" checked="checked" />java
            </label>
            <label class="btn btn-warning">
                <input type="radio" name="aa" />Python
            </label>
            <label class="btn btn-warning">
                <input type="radio" name="aa" />JavaScript
            </label>
        </div>
        <div class="btn-toolbar">
            <div class="btn-group mt-5 mr-2">
                <button class="btn btn-danger">1</button>
                <button class="btn btn-danger">2</button>
                <button class="btn btn-danger">3</button>
            </div>
            <div class="btn-group mt-5 mr-2">
                <button class="btn btn-danger">4</button>
                <button class="btn btn-danger">5</button>
                <button class="btn btn-danger">6</button>
            </div>
        </div>
        <div class="btn-group mt-5 mr-2 btn-group-lg">
            <button class="btn btn-danger">1</button>
            <button class="btn btn-danger">2</button>
            <button class="btn btn-danger">3</button>
        </div>
        <div class="btn-group mt-5 mr-2 btn-group-sm btn-group-vertical">
            <button class="btn btn-danger">4</button>
            <button class="btn btn-danger">5</button>
            <button class="btn btn-danger">6</button>
上一篇 下一篇

猜你喜欢

热点阅读