サルでもわかるWEBプログラミング

フリーソフトのみでホームページ作成

ユーザ用ツール

サイト用ツール


00.cssフレームワークbulma用テンプレート:03.ヘッダーnavbarとフッターfooter


差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

次のリビジョン
前のリビジョン
00.cssフレームワークbulma用テンプレート:03.ヘッダーnavbarとフッターfooter [2020/11/24]
adash333 作成
00.cssフレームワークbulma用テンプレート:03.ヘッダーnavbarとフッターfooter [2021/01/08]
adash333 [サンプルコード]
行 5: 行 5:
 https://stackoverflow.com/questions/43727032/hero-footer-not-at-bottom-of-page https://stackoverflow.com/questions/43727032/hero-footer-not-at-bottom-of-page
 フッターを、画面下に固定 フッターを、画面下に固定
 +
 +<code>
 +.main {
 +  display: flex;
 +  min-height: 100vh;
 +  flex-direction: column;
 +}
 +
 +.section {
 +  flex: 1;
 +}
 +And then adjust your template like this:
 +
 +<body class="main">
 +  <div class="section">
 +    ...
 +  </div>
 +  <footer class="footer">
 +    ...
 +  </footer>
 +</body>
 +</code>
 +
 +
 +===== サンプルコード =====
 +
 +index.html
 +<code>
 +<!DOCTYPE html>
 +<html>
 +<head>
 +  <meta charset="utf-8">
 +  <meta name="viewport" content="width=device-width, initial-scale=1">
 +  <title>Hello Bulma!</title>
 +  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css">
 +  <link rel="stylesheet" href="style.css">
 +  
 +  <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
 +  <style>
 +  </style>
 +</head>
 +<body class="main">
 +    
 +  <nav class="navbar has-background-info">
 +    <div class="navbar-brand">
 +      <a class="navbar-item has-text-white" href="#">
 +        Bulmaテンプレート
 +      </a>
 +    </div>
 +  </nav>
 +    
 +  <section class="section">
 +    <div class="container">
 +      <!-- ここにコンテンツを記載 -->
 +    </div>
 +  </section>
 +
 +  <footer class="footer">
 +    <div class="content has-text-centered">
 +      <a href="https://i-doctor.sakura.ne.jp/font/">Wordpressでフリーオリジナルフォント</a>
 +    </div>
 +  </footer>
 +
 +  <script>
 +  </script>
 +
 +</body>
 +</html>
 +</code>
 +
 +
 +style.css
 +<code>
 +.main {
 +  display: flex;
 +  min-height: 100vh;
 +  flex-direction: column;
 +}
 +
 +.section {
 +  flex: 1;
 +}
 +
 +.footer {
 +  background-color: #f0f0f0;
 +}
 +</code>
 +
 +{{ :00.cssフレームワークbulma用テンプレート:screenshot_20210108-205842_2.png |}}
  
  


00.cssフレームワークbulma用テンプレート/03.ヘッダーnavbarとフッターfooter.txt · 最終更新: 2021/01/08 by adash333