【Django】开源前端库bootstrap,常用


在这里插入图片描述

这里使用成熟的V4版本,中文文档地址:https://v4.bootcss.com/docs/getting-started/introduction/

下载bootstrap源文件到本地项目

在这里插入图片描述
https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css
https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js
以上链接打开后,文件另存为即可
在这里插入图片描述

引入bootstrap文件

<!doctype html>
<html lang="zh-CN">
    <head>
        <!-- 必须的 meta 标签 -->
        <meta charset="utf-8">
        <meta name="viewport"
            content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <!-- Bootstrap 的 CSS 文件 -->
        <link rel="stylesheet" href="./static/antapp/bootstrap/bootstrap.min.css">
        <title>Hello, world!</title>
    </head>
    <body>
        <h1>Hello, world!</h1>

        <table class="table">
            <thead class="thead-dark">
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">First</th>
                    <th scope="col">Last</th>
                    <th scope="col">Handle</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th scope="row">1</th>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                </tr>
                <tr>
                    <th scope="row">2</th>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                </tr>
                <tr>
                    <th scope="row">3</th>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                </tr>
            </tbody>
        </table>
        <!-- JavaScript 文件是可选的。从以下两种建议中选择一个即可! -->

        <!-- 选项 1:jQuery 和 Bootstrap 集成包(集成了 Popper) -->
        <script src="./static/antapp/bootstrap/jquery.min.js"></script>
        <script src="./static/antapp/bootstrap/bootstrap.bundle.min.js"></script>

    </body>
</html>

在这里插入图片描述
中文文档地址:https://v4.bootcss.com/docs/getting-started/introduction/

  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值