1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

coeureさんを引用 3カラムの作り方

Last updated at Posted at 2019-09-14

お恥ずかしながら一通り勉強した後に、3カラムが出来ないままであることを忘れておりまして、これから次に書いてあるプログラムを書いて、動作確認をしてみます。汗 恥ずかしい。

base-3column.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>はじめてのホームページ</title>

    <link rel="stylesheet" href="style.css">

  </head>
  <body>

    <div class="header">
      ここにはヘッダーが入ります
    </div>

    <div class="main">
    	<div class="main-contents">
        メインコンテンツ
      </div>
    	<div class="right-navi">
        右側のカラム
      </div>
      </div>
        <div class="left-navi">
        左側のカラム
      </div>

    <div class="footer">
      ここにはフッターメニューが入ります
    </div>

  </body>
</html>
3column.css
body{
  background-color: lightyellow;
}
.header {
  height: 150px;
  background-color: yellow;
}
.footer{
  height: 200px;
  background: black;
  color: #fff;
  clear: both;
}
.main-contents, .left-navi, .right-navi {
  height: 400px;
}
.main-contents {
  background-color: red;
  color: #fff;
  float: left;
  width: 80%;
}
.left-navi {
  background-color: blue;
  color: #fff;
  width: 20%;
  float: right;
}
.right-navi {
  background-color: green;
  color: #fff;
  float: right;
  width: 20%;
}
.main{
  width: 80%;
  float: right;
}

やっと出来た!
Screenshot from 2019-09-14 21-29-48.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?