Bootstrap学习笔记 01 - 开始

获取 Bootstrap

通过 bower 获取:

bower install bootstrap

如果用到 jQuery,则可以通过 npm 下载:

npm install --save jquery

也可以通过CDN方式引入 Bootstrap:

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

第一个页面

<!-- 文档类型,Bootstrap 要求使用 HTML5 doctype -->
<!DOCTYPE html>
<html>
    <head>
        <!-- 使用 utf-8 字符集 -->
        <meta charset="utf-8" />
        <!-- 
            引入 Bootstrap 
            也可以通过CDN 方式引入 
            <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> 
        -->
        <link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css" />
        <!-- 
            viewport 指定渲染和缩放的方式
            width=device-width 根据不同设备屏幕的宽度设置页面的宽度
            initial-scale=1 设置初始缩放级别,1表示不缩放
         -->
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>Hello World!</title>
    </head>

    <!-- 
        Bootstrap 包含两种容器,用以指定整个页面内容的样式 
        .container 为 fixed-width 容器
        .container-fluid 为 full width 容器,即宽度占满整个屏幕
    -->
    <div class="container">
        <h1>Hello World!</h1>
        <p>
            This is my first Bootstrap web! How does it look like?
        </p>
    </div>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值