はじめにhtml、同一ファイル内にそれぞれのファイルを用意しましょう。
cssファイルの中には、
・bootstrap.css.map
・bootstrap.min.css
・bootstrap-theme.css.map
・bootstrap-theme.min.css
fontファイルの中には、
・glyphicons-halflings-regular.eot
・glyphicons-halflings-regular.svg
・glyphicons-halflings-regular.ttf
・glyphicons-halflings-regular.woff
jsファイルの中には、
・bootstrap.min.js
を用意しましょう。
今度はすべてのボタンをくっつけてグループ化します。
【CSS#17】BootstrapとjQueryのグループ化されてまとめられた色の違うボタン
Button.html

<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <!-- ビューポートの設定--> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>UPDOWN TECH</title> <!-- Bootstrapで使うCSSの読み込み--> <link href="css/bootstrap.min.css" rel="stylesheet"> </head> <body> <section class="container"> <button type="button" class="btn btn-default">普通</button> <button type="button" class="btn btn-primary">準備中</button> <button type="button" class="btn btn-success">成功</button> <button type="button" class="btn btn-info">その他</button> <button type="button" class="btn btn-warning">エラー</button> <button type="button" class="btn btn-danger">警告</button> <button type="button" class="btn btn-link">こちら</button> </section> <!-- jQueryの読み込み--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <!-- Bootstrapで使うJavaScriptの読み込み--> <script src="js/bootstrap.min.js"></script> </body> </html>
まとめ
グループ化されたボタンはサイト上部のメニュー(ナビゲーション)で見られることが多いでしょう。
Bootstrapを使えればよりポートフォリオの質がアップします。
大学生やIT就活生もぜひプログラミングしてみてくださいね。