【ソースコード】中級編:ストアサイト(インテリア)/グリッドレイアウト

目次

※コーディングの解説はCSSのコメントを参照

ディレクトリ構成

    
store2
 ├─img
 │  ├─favicon.ico
 │  ├─logo.svg
 │  └─item1.jpg ~ item16.jpg
 │
 ├─css
 │  └─style.css
 │
 ├─js
 │  └─main.js
 │
 ├─about.html
 ├─company.html
 ├─index.html
 ├─item1.html ~ item16.html
 ├─products.html
 └─products2.html
    
  

HTML(トップページ / index.html)

別タブで開く
index.html

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>Furniture Design</title>
    <meta name="description" content="テキストテキストテキストテキストテキストテキストテキスト">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="js/main.js"></script>
  </head>

  <body>
    <header id="header" class="wrapper">
      <h1 class="site-title">
        <a href="index.html"><img src="img/logo.svg" alt="Furniture Design"></a>
      </h1>

      <nav id="navi">
        <ul class="nav-menu">
          <li><a href="products.html">PRODUCTS</a></li>
          <li><a href="about.html">ABOUT</a></li>
          <li><a href="company.html">COMPANY</a></li>
          <li><a href="mailto:xxxxx@xxx.xxx?subject=お問い合わせ">CONTACT</a></li>
        </ul>
      </nav>

      <div class="toggle_btn">
        <span></span>
        <span></span>
      </div>

      <div id="mask"></div>
    </header>

    <main>
      <div id="top" class="wrapper">
        <ul class="product-list">
          <li>
            <a href="item1.html">
              <img src="img/item1.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item2.html">
              <img src="img/item2.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item3.html">
              <img src="img/item3.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item4.html">
              <img src="img/item4.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item5.html">
              <img src="img/item5.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item6.html">
              <img src="img/item6.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item7.html">
              <img src="img/item7.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item8.html">
              <img src="img/item8.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
        </ul>
        <a class="link-text" href="products.html">View More</a>
      </div>
    </main>

    <footer id="footer" class="wrapper">
      <ul class="menu">
        <li><a href="https://www.instagram.com/" target="_blank">INSTAGRAM</a></li>
        <li><a href="https://twitter.com/" target="_blank">TWITTER</a></li>
        <li><a href="https://www.facebook.com/" target="_blank">FACEBOOK</a></li>
      </ul>
      <p class="copyright">&copy; Furniture Design</p>
    </footer>
  </body>
</html>


HTML(Productsページ / products.html)

別タブで開く
products.html

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>Products | Furniture Design</title>
    <meta name="description" content="テキストテキストテキストテキストテキストテキストテキスト">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="js/main.js"></script>
  </head>

  <body>
    <header id="header" class="wrapper">
      <div class="site-title">
        <a href="index.html"><img src="img/logo.svg" alt="Furniture Design"></a>
      </div>

      <nav id="navi">
        <ul class="nav-menu">
          <li><a href="products.html">PRODUCTS</a></li>
          <li><a href="about.html">ABOUT</a></li>
          <li><a href="company.html">COMPANY</a></li>
          <li><a href="mailto:xxxxx@xxx.xxx?subject=お問い合わせ">CONTACT</a></li>
        </ul>
      </nav>

      <div class="toggle_btn">
        <span></span>
        <span></span>
      </div>

      <div id="mask"></div>
    </header>

    <main>
      <div class="content wrapper">
        <h1 class="page-title">Products</h1>
        <ul class="product-list">
          <li>
            <a href="item1.html">
              <img src="img/item1.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item2.html">
              <img src="img/item2.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item3.html">
              <img src="img/item3.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item4.html">
              <img src="img/item4.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item5.html">
              <img src="img/item5.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item6.html">
              <img src="img/item6.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item7.html">
              <img src="img/item7.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item8.html">
              <img src="img/item8.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item9.html">
              <img src="img/item9.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item10.html">
              <img src="img/item10.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item11.html">
              <img src="img/item11.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
          <li>
            <a href="item12.html">
              <img src="img/item12.jpg" alt="">
              <p>プロダクトタイトルプロダクトタイトル</p>
              <p>&yen;99,999 +tax</p>
            </a>
          </li>
        </ul>
        <ul class="pagination">
          <li>1</li>
          <li><a href="products2.html">2</a></li>
        </ul>
      </div>
    </main>

    <footer id="footer" class="wrapper">
      <ul class="menu">
        <li><a href="https://www.instagram.com/" target="_blank">INSTAGRAM</a></li>
        <li><a href="https://twitter.com/" target="_blank">TWITTER</a></li>
        <li><a href="https://www.facebook.com/" target="_blank">FACEBOOK</a></li>
      </ul>
      <p class="copyright">&copy; Furniture Design</p>
    </footer>
  </body>
</html>


HTML(Products詳細ページ / item1.html)

※item2~item16.html についても、ファイル名以外は同じ内容です。

別タブで開く
item1.html

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>プロダクトタイトル | Furniture Design</title>
    <meta name="description" content="テキストテキストテキストテキストテキストテキストテキスト">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="js/main.js"></script>
  </head>

  <body>
    <header id="header" class="wrapper">
      <div class="site-title">
        <a href="index.html"><img src="img/logo.svg" alt="Furniture Design"></a>
      </div>

      <nav id="navi">
        <ul class="nav-menu">
          <li><a href="products.html">PRODUCTS</a></li>
          <li><a href="about.html">ABOUT</a></li>
          <li><a href="company.html">COMPANY</a></li>
          <li><a href="mailto:xxxxx@xxx.xxx?subject=お問い合わせ">CONTACT</a></li>
        </ul>
      </nav>

      <div class="toggle_btn">
        <span></span>
        <span></span>
      </div>

      <div id="mask"></div>
    </header>

    <main>
      <div class="content wrapper">
        <h1 class="page-title">プロダクトタイトル</h1>
        <div id="item">
          <div class="item-img">
            <img src="img/item1.jpg" alt="">
          </div>
          <div class="item-text">
            <p>
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            </p>
            <p>
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
              テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            </p>
            <p>&yen;99,999 +tax</p>
            <dl>
              <dt>SIZE:</dt>
              <dd>W999 × D999 × H999</dd>
              <dt>COLOR:</dt>
              <dd>テキスト</dd>
              <dt>MATERIAL:</dt>
              <dd>テキストテキストテキスト</dd>
            </dl>
          </div>
        </div>
        <a class="link-text" href="products.html">Back To Products</a>
      </div>
    </main>

    <footer id="footer" class="wrapper">
      <ul class="menu">
        <li><a href="https://www.instagram.com/" target="_blank">INSTAGRAM</a></li>
        <li><a href="https://twitter.com/" target="_blank">TWITTER</a></li>
        <li><a href="https://www.facebook.com/" target="_blank">FACEBOOK</a></li>
      </ul>
      <p class="copyright">&copy; Furniture Design</p>
    </footer>
  </body>
</html>


HTML(Aboutページ / about.html)

別タブで開く
about.html

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>About | Furniture Design</title>
    <meta name="description" content="テキストテキストテキストテキストテキストテキストテキスト">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="js/main.js"></script>
  </head>

  <body>
    <header id="header" class="wrapper">
      <div class="site-title">
        <a href="index.html"><img src="img/logo.svg" alt="Furniture Design"></a>
      </div>

      <nav id="navi">
        <ul class="nav-menu">
          <li><a href="products.html">PRODUCTS</a></li>
          <li><a href="about.html">ABOUT</a></li>
          <li><a href="company.html">COMPANY</a></li>
          <li><a href="mailto:xxxxx@xxx.xxx?subject=お問い合わせ">CONTACT</a></li>
        </ul>
      </nav>

      <div class="toggle_btn">
        <span></span>
        <span></span>
      </div>

      <div id="mask"></div>
    </header>

    <main>
      <div class="content wrapper">
        <h1 class="page-title">About</h1>
        <div id="about">
          <p>
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
          </p>
          <p>
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
            テキストテキストテキストテキストテキストテキストテキストテキストテキスト
          </p>
        </div>
      </div>
    </main>

    <footer id="footer" class="wrapper">
      <ul class="menu">
        <li><a href="https://www.instagram.com/" target="_blank">INSTAGRAM</a></li>
        <li><a href="https://twitter.com/" target="_blank">TWITTER</a></li>
        <li><a href="https://www.facebook.com/" target="_blank">FACEBOOK</a></li>
      </ul>
      <p class="copyright">&copy; Furniture Design</p>
    </footer>
  </body>
</html>


HTML(Companyページ / company.html)

別タブで開く
company.html

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>Company | Furniture Design</title>
    <meta name="description" content="テキストテキストテキストテキストテキストテキストテキスト">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="js/main.js"></script>
  </head>

  <body>
    <header id="header" class="wrapper">
      <div class="site-title">
        <a href="index.html"><img src="img/logo.svg" alt="Furniture Design"></a>
      </div>

      <nav id="navi">
        <ul class="nav-menu">
          <li><a href="products.html">PRODUCTS</a></li>
          <li><a href="about.html">ABOUT</a></li>
          <li><a href="company.html">COMPANY</a></li>
          <li><a href="mailto:xxxxx@xxx.xxx?subject=お問い合わせ">CONTACT</a></li>
        </ul>
      </nav>

      <div class="toggle_btn">
        <span></span>
        <span></span>
      </div>

      <div id="mask"></div>
    </header>

    <main>
      <div class="content wrapper">
        <h1 class="page-title">Company</h1>
        <div id="company">
          <dl class="info">
            <dt>社名</dt>
            <dd>株式会社ファニチャーデザイン</dd>
            <dt>住所</dt>
            <dd>〒107-0062 東京都港区南青山1丁目××××××</dd>
            <dt>設立</dt>
            <dd>XXXX年XX月</dd>
            <dt>資本金</dt>
            <dd>XXXX万円</dd>
            <dt>従業員数</dt>
            <dd>XX名</dd>
            <dt>事業内容</dt>
            <dd>
              家具、インテリアの企画・生産<br>
              家具、インテリアの販売<br>
              店舗の企画・デザイン・設計
            </dd>
          </dl>
          <div class="map">
            <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3241.2914382280856!2d139.72342666557796!3d35.669825288204194!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x60188c820ac932eb%3A0xc68079dd10afd971!2z44CSMTA3LTAwNjIg5p2x5Lqs6YO95riv5Yy65Y2X6Z2S5bGx77yR5LiB55uu!5e0!3m2!1sja!2sjp!4v1611987713735!5m2!1sja!2sjp"></iframe>
          </div>
        </div>
      </div>
    </main>

    <footer id="footer" class="wrapper">
      <ul class="menu">
        <li><a href="https://www.instagram.com/" target="_blank">INSTAGRAM</a></li>
        <li><a href="https://twitter.com/" target="_blank">TWITTER</a></li>
        <li><a href="https://www.facebook.com/" target="_blank">FACEBOOK</a></li>
      </ul>
      <p class="copyright">&copy; Furniture Design</p>
    </footer>
  </body>
</html>


CSS(style.css)

別タブで開く
style.css

@charset "UTF-8";

html {
  font-size: 100%;
}
/*
フッターを画面下に配置するために、
「position: relative;」を設定
「min-height」で最小の高さを画面の高さにあわせる
*/
body {
  color: #333;
  font-size: 0.875rem;
  min-height: 100vh;
  position: relative;
}
a {
  color: #333;
  text-decoration: none;
  transition: all 0.5s;
}
a:hover {
  opacity: 0.7;
}
img {
  max-width: 100%;
}
li {
  list-style: none;
}
/*
コンテンツ幅を設定するための共通クラス
*/
.wrapper {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
}
.content {
  padding-top: 120px;
  padding-bottom: 160px;
}
.site-title a {
  width: 180px;
  line-height: 1px;
  display: block;
}
.page-title {
  font-size: 0.875rem;
  font-weight: normal;
  margin-bottom: 30px;
}

/*-------------------------------------------
ヘッダー
-------------------------------------------*/
/*
「position: fixed;」でヘッダーを固定し、「z-index: 10;」で前面に表示
※他のコンテンツでpositionをrelative、absolute、fixedのいずれかに
設定している場合は、z-indexの数値が大きい方が前面に表示される
*/
#header {
  width: 100%;
  height: 80px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10
}
/*
ハンバーガーメニュー
メニューが閉じている時は、「left: -300px;」で画面左に隠し、
「opacity: 0;」で非表示にしている
*/
#navi {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  color: #fff;
  padding: 36px 50px;
  transition: all 0.5s;
  z-index: 20;
  opacity: 0;
}
#navi a {
  color: #fff;
}
#navi li {
  margin-bottom: 14px;
}
/*
ハンバーガーメニュー
メニューが開いている時は、「left: 0;」「opacity: 1;」で
画面左に表示する
*/
.open #navi {
  left: 0;
  opacity: 1;
}
.toggle_btn {
  width: 30px;
  height: 30px;
  position: relative;
  transition: all 0.5s;
  cursor: pointer;
  z-index: 20;
}
/*
ハンバーガーメニューの線の設定(メニューが閉じている時)
*/
.toggle_btn span {
  display: block;
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: #333;
  border-radius: 4px;
  transition: all 0.5s;
}
/*
1本目の線の位置を設定
*/
.toggle_btn span:nth-child(1) {
  top: 10px;
}
/*
2本目の線の位置を設定
*/
.toggle_btn span:nth-child(2) {
  bottom: 10px;
}
/*
ハンバーガーメニューの線の設定(メニューが開いている時)
線の色を白に変更
*/
.open .toggle_btn span {
  background-color: #fff;
}
/*
1本目の線を-45度回転
*/
.open .toggle_btn span:nth-child(1) {
  -webkit-transform: translateY(4px) rotate(-45deg);
  transform: translateY(4px) rotate(-45deg);
}
/*
2本目の線を45度回転
*/
.open .toggle_btn span:nth-child(2) {
  -webkit-transform: translateY(-4px) rotate(45deg);
  transform: translateY(-4px) rotate(45deg);
}
#mask {
  display: none;
  transition: all 0.5s;
}
/*
メニューを開いている時は、全体を黒背景にする
*/
.open #mask {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: .8;
  z-index: 10;
  cursor: pointer;
}

/*-------------------------------------------
TOP、PRODUCTS
-------------------------------------------*/
#top {
  padding-top: 80px;
  padding-bottom: 160px;
}
.product-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.product-list li {
  width: 23%;
  margin-bottom: 40px;
}
/*
vertical-align: top;
画像の下にできる隙間を消す
*/
.product-list img {
  margin-bottom: 10px;
  vertical-align: top;
}
.product-list p {
  font-size: 0.75rem;
}
.link-text {
  display: block;
  text-align: center;
}
.pagination {
  display: flex;
  justify-content: center;
}
.pagination li {
  padding: 0 20px;
}

/*-------------------------------------------
ITEM
-------------------------------------------*/
#item {
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 60px;
}
#item .item-text {
  width: 42%;
}
/*
text-align: justify;
テキストの両端を揃える
*/
#item .item-text p {
  margin-bottom: 30px;
  text-align: justify;
}
#item .item-text dl {
  display: flex;
  flex-wrap: wrap;
}
#item .item-text dt {
  width: 30%;
}
#item .item-text dd {
  width: 70%;
}
#item .item-img {
  width: 50%;
}

/*-------------------------------------------
ABOUT
-------------------------------------------*/
#about {
  max-width: 600px;
}
#about p {
  line-height: 1.9;
  margin-bottom: 30px;
}

/*-------------------------------------------
COMPANY
-------------------------------------------*/
#company {
  max-width: 600px;
}
#company dl {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
#company dt {
  width: 30%;
  border-bottom: solid 1px #dcdbdb;
  padding: 20px 10px;
}
#company dt:last-of-type {
  border-bottom: none;
}
#company dd {
  width: 70%;
  border-bottom: solid 1px #dcdbdb;
  padding: 20px 10px;
}
#company dd:last-of-type {
  border-bottom: none;
}
#company .map {
  /* グーグルマップをグレースケールにする */
  filter: grayscale(1);
}
/* グーグルマップのサイズを設定 */
#company .map iframe {
  width: 100%;
  height: 300px;
  border: 0;
}

/*-------------------------------------------
フッター
-------------------------------------------*/
/*
「position: absolute;」を設定して、フッター位置を画面下に設定
「left: 0;」「right: 0;」で中央に配置
*/
#footer {
  display: flex;
  justify-content: space-between;
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
}
#footer .menu {
  display: flex;
}
#footer .menu li {
  font-size: 0.75rem;
  margin-right: 30px;
}
#footer .copyright {
  font-size: 0.625rem;
}

/*-------------------------------------------
SP
-------------------------------------------*/
@media screen and (max-width: 900px) {

  /*-------------------------------------------
  TOP、PRODUCTS
  -------------------------------------------*/
  .product-list li {
    width: 47%;
  }

  /*-------------------------------------------
  ITEM
  -------------------------------------------*/
  #item {
    flex-direction: column;
  }
  #item .item-text {
    width: 100%;
  }
  #item .item-img {
    width: 100%;
    margin-bottom: 30px;
  }

  /*-------------------------------------------
  COMPANY
  -------------------------------------------*/
  #company dl {
    flex-direction: column;
  }
  #company dt {
    width: 100%;
    border-bottom: none;
    padding-bottom: 5px;
  }
  #company dd {
    width: 100%;
    padding-top: 5px;
  }

  /*-------------------------------------------
  フッター
  -------------------------------------------*/
  #footer {
    flex-direction: column;
  }
  #footer .menu {
    margin-bottom: 5px;
  }
}

JavaScript(main.js)

別タブで開く
main.js

$(function(){
  /*=================================================
  ハンバーガーメニュー
  ===================================================*/
  // ハンバーガーメニューのクリックイベント
  $('.toggle_btn').on('click', function() {
    // #headerにopenクラスが存在する場合
    if ($('#header').hasClass('open')) {
      // openクラスを削除
      // openクラスを削除すると、openクラスのCSSがはずれるため、
      // メニューが非表示になる
      $('#header').removeClass('open');

    // #headerにopenクラスが存在しない場合
    } else {
      // openクラスを追加
      // openクラスを追加すると、openクラスのCSSが適応されるため、
      // メニューが表示される
      $('#header').addClass('open');
    }
  });

  // メニューが表示されている時に画面をクリックした場合
  $('#mask').on('click', function() {
    // openクラスを削除して、メニューを閉じる
    $('#header').removeClass('open');
  });
});

ハンバーガーメニューの仕組み

最初は非表示
ハンバーガーメニュー「#navi」には、「opacity: 0;」が設定されているので、最初は非表示の状態です。
メニューをクリック(メニューを開く)
ハンバーガーメニューをクリックすると、main.jsの以下イベントが動作します。
$('.toggle_btn').on('click', function() {
headerタグにopenクラスを追加
イベントが動作すると、はじめはheaderタグにopenクラスが存在しないので、 イベントの中の「$('#header').addClass('open');」が実行され、headerタグにopenクラスが追加されます。
openクラスのCSSが認識されメニューが表示される
headerタグにopenクラスが追加されると、openクラスのCSS「.open #navi」が認識されるので、 メニューが表示されるようになります。(「.open #navi」には、「opacity: 1;」が設定されているため)
もう一度メニューをクリック(メニューを閉じる)
この状態で、もう一度ハンバーガーメニューをクリックすると、 今度はすでにheaderタグの中にopenクラスが存在しているので 「$('#header').removeClass('open');」が実行され、headerタグからopenクラスが削除されます。
openクラスのCSSが認識されなくなりメニューが非表示になる
headerタグからopenクラスが削除されると、openクラスのCSS「.open #navi」が認識されなくなるので、 メニューが非表示になります。