Python Web开发:安装bootstrap
来自CloudWiki
Bootstrap的安装
下载Bootstrap包到本地
- 您可以从 https://v3.bootcss.com/getting-started/上下载 Bootstrap 的版本。为了方便对Bootstrap中的组件进行二次开发,这里选择“下载源码”
文件结构
下载完成后解压,找到其中的dist文件夹,该文件夹中包含三个子文件夹:css ,fonts和 js
这些文件已经封装好了大量Web开发可直接调用的组件和字体库。
第一个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>