Python Web开发:安装bootstrap

来自CloudWiki
跳转至: 导航搜索


Bootstrap的安装

下载Bootstrap包到本地

  • Web21040301.png


文件结构

下载完成后解压,找到其中的dist文件夹,该文件夹中包含三个子文件夹:css ,fonts和 js

这些文件已经封装好了大量Web开发可直接调用的组件和字体库。

  • W8-29.png

第一个BootStrap页面

创建工程

新建一个文件夹为Bootdomo,把下载下来的css ,fonts和 js子文件夹放入Bootdomo文件夹中

 
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap简单示例</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js">
    </script>
    <script src="js/bootstrap.min.js"></script>
</head>

<body>
    <div class="alert alert-success" role="alert">Python Web实战</div>
    <div class="alert alert-info" role="alert">Python Web实战</div>
    <div class="alert alert-warning" role="alert">Python Web实战</div>
</body>

</html>

Web21040302.png