「bootstrapでメニュー、ナビゲーション」の編集履歴(バックアップ)一覧に戻る

bootstrapでメニュー、ナビゲーション - (2016/03/23 (水) 22:41:07) のソース

bootstrapでメニューやナビゲーションを作る。3月23日記事
~
~
目次
#contents
~
~
----
~
*概要
スマートフォン用のメニューとPC用のメニューを作る。スマートフォンの場合は、メニューボタンを押すと、下にドロップダウンする感じでメニューがあらわれる。
~
~

*コード
 <!DOCTYPE html>
 <html lang="ja">
   <head></head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
     <title>bootstrapの練習</title>
 
     <!-- Bootstrap -->
     <link href="css/reset.css" rel="stylesheet">
     <link href="css/bootstrap.min.css" rel="stylesheet">
     <link href="css/style.css" rel="stylesheet">
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
     <!--[if lt IE 9]>
       <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
       <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
     <![endif]-->
   </head>
   <body>
     <div class="container">
       <nav class="navbar navbar-default navbar-fixed-top">
         <div class="container">
           <div class="navbar-header">
             <button class="navbar-toggle" data-toggle="collapse" data-target="#mainNav">
               <span class="sr-only">ナビゲーション</span><!--目の不自由な方向け-->
               <span class="icon-bar"></span><!--三本線を三つ-->
               <span class="icon-bar"></span>
               <span class="icon-bar"></span>
             </button>
             <a href="#" class="navbar-brand">適当なサイト名</a>
           </div>
           <div class="collapse navbar-collapse" id="mainNav">
             <ul class="nav navbar-nav">
               <li class="active">
                 <a href="#"><span class="glyphicon glyphicon-home"></span>ホーム</a>
               </li>
               <li class="active">
                 <a href="#"><span class="glyphicon glyphicon-user"></span>ユーザ</a>
               </li>
               <li class="active">
                 <a href="#"><span class="glyphicon glyphicon-file"></span>ファイル</a>
               </li>
             </ul>
           </div>
         </div>
 
       </nav>
     </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>