dayjournal memo

Total 975 articles!!

Bootstrap #003 - ジャンボトロン

Yasunori Kirimoto's avatar

Bootstrapでジャンボトロンを構築するには下記のようにします。


Bootstrapのサイト内のJumbotronの記述をコピーしてindex.htmlに貼り付けます。

Bootstrap_003_01



<!DOCTYPE html>
<html lang="ja">
    <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 sample</title>

        <!-- Bootstrap -->
        <link href="css/bootstrap.min.css" rel="stylesheet">

    </head>
    <body>

        <div class="jumbotron">
                <h1>Hello, world!</h1>
                <p>...</p>
                <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
        </div>

        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="js/bootstrap.min.js"></script>
    </body>
</html>

作成したindex.htmlを実行すると下記のように表示されます。

Bootstrap_003_02


要素を中央に寄せる: div class=“jumbotron”~の記述にcontainerを追加します。


<div class = "container">
    <div class="jumbotron">
        <h1>Hello, world!</h1>
        <p>...</p>
        <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
    </div>
</div>


book

Q&A