BootStrap笔记-按钮相关

程序运行截图如下:

源码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CN_TEST1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!--    bootstrap css核心文件-->
    <link rel="stylesheet" href="bootstrap-4.4.1-dist/css/bootstrap.min.css">
<!--    bootstrap使用到了jquery,需要提前引用-->
    <script src="js/jquery-3.5.1.min.js"></script>
<!--    弹窗、提示、下拉菜单-->
    <script src="bootstrap-4.4.1-dist/js/bootstrap.bundle.js"></script>
<!--    bootstrap核心文件-->
    <script src="bootstrap-4.4.1-dist/js/bootstrap.min.js"></script>

</head>
<body>
    <div class="container-fluid">
        <button type="button" class="btn">btn按钮</button>
        <button type="button" class="btn btn-primary">btn-primary按钮</button>
        <button type="button" class="btn btn-secondary">btn-secondary按钮</button>
        <button type="button" class="btn btn-success">btn-success按钮</button>
        <button type="button" class="btn btn-info">btn-info按钮</button>
        <button type="button" class="btn btn-warning">btn-warning按钮</button>
        <button type="button" class="btn btn-dark">btn-dark按钮</button>
        <button type="button" class="btn btn-light">btn-light按钮</button>
        <button type="button" class="btn btn-link">btn-link按钮</button>
        <br/>
        <button type="button" class="btn">btn按钮</button>
        <button type="button" class="btn btn-outline-primary">btn-primary按钮</button>
        <button type="button" class="btn btn-outline-secondary">btn-secondary按钮</button>
        <button type="button" class="btn btn-outline-success">btn-success按钮</button>
        <button type="button" class="btn btn-outline-info">btn-info按钮</button>
        <button type="button" class="btn btn-outline-warning">btn-warning按钮</button>
        <button type="button" class="btn btn-outline-dark">btn-dark按钮</button>
        <button type="button" class="btn btn-outline-light">btn-light按钮</button>
        <button type="button" class="btn btn-outline-link">btn-link按钮</button>
        <br/>
        <button type="button" class="btn">btn按钮</button>
        <button type="button" class="btn btn-outline-primary btn-lg">btn-primary按钮</button>
        <button type="button" class="btn btn-outline-secondary btn-lg">btn-secondary按钮</button>
        <button type="button" class="btn btn-outline-success btn-lg">btn-success按钮</button>
        <button type="button" class="btn btn-outline-info btn-lg">btn-info按钮</button>
        <button type="button" class="btn btn-outline-warning btn-lg">btn-warning按钮</button>
        <button type="button" class="btn btn-outline-dark btn-lg">btn-dark按钮</button>
        <button type="button" class="btn btn-outline-light btn-lg">btn-light按钮</button>
        <button type="button" class="btn btn-outline-link btn-lg">btn-link按钮</button>
        <br/>
        <button type="button" class="btn">btn按钮</button>
        <button type="button" class="btn btn-outline-primary btn-lg btn-block">btn-primary按钮</button>
        <button type="button" class="btn btn-outline-secondary btn-lg btn-block">btn-secondary按钮</button>
        <button type="button" class="btn btn-outline-success btn-lg btn-block">btn-success按钮</button>
        <button type="button" class="btn btn-outline-info btn-lg btn-block">btn-info按钮</button>
        <button type="button" class="btn btn-outline-warning btn-lg btn-block">btn-warning按钮</button>
        <button type="button" class="btn btn-outline-dark btn-lg btn-block">btn-dark按钮</button>
        <button type="button" class="btn btn-outline-light btn-lg btn-block">btn-light按钮</button>
        <button type="button" class="btn btn-outline-link btn-lg btn-block">btn-link按钮</button>
        <br/>
        <button type="button" class="btn btn-outline-primary btn-lg btn-block active">btn-primary按钮</button>
        <button type="button" class="btn btn-outline-secondary btn-lg btn-block" disabled>btn-secondary按钮</button>
        <br/>
        <button class="btn btn-primary">
            <span class="spinner-border spinner-border-sm"></span>
        </button>
        <button class="btn btn-primary">
            <span class="spinner-border spinner-border-sm"></span>
            Loading...
        </button>
        <button class="btn btn-primary">
            <span class="spinner-grow spinner-grow-sm"></span>
            Loading...
        </button>
    </div>
</body>
</html>

解释:

①span中的一个类是spinner-border和sprnner-graw分别代表的效果:

②使用BootStrap的button属性时,要用btn类,后面再接各种不同的类样式。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT1995

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值