フルードグリッド実践

Fluid Grid (フルードグリッド)

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>レスポンシブレイアウト</title>
<meta name="viewport" content="width=device-width">
<style>
html, body {
  margin: 0;
  padding: 0;
}
body {
  background: #ECECEC;
}
.container {
  overflow: hidden;
  width: 960px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  background: #FFF;
}
.content {
  float: left;
  width: 64%;
  height: 500px;
  padding: 20px;
  box-sizing: border-box;
  background: #AAA;
}
.sidemenu {
  float: right;
  width: 30%;
  height: 300px;
  padding: 20px;
  box-sizing: border-box;
  background: #AAA;
}
.footer {
  width: 100%;
  height: 100px;
  background: #AAA;
}

@media screen and (max-width: 959px) {
  .container {
    width: 100%;
  }
}

@media screen and (max-width: 767px) {
  .content {
     float: none;
     width: 100%;
     margin-bottom: 20px;
   }
   .sidemenu {
     float: none;
     width: 100%;
   }
}
</style>
</head>
<body>
<div class="container">

<main class="content">	
</main><!-- /.content -->

<aside class="sidemenu">
</aside><!-- /.submenu -->

</div><!-- /.container -->

<footer class="footer">
</footer><!-- /.footer -->

</body>
</html>


f:id:web-0220:20180709173842p:plain

f:id:web-0220:20180709174152p:plain