1. ホームページ作成トップ >
  2. ページレイアウト >
  3. 2カラム右サイドバーページレイアウト

2カラム右サイドバーページレイアウト

スタイルシート(CSS)を使ってページをすっきりさせる


2カラム右サイドバーページレイアウト

HTMLタグ
<html lang="ja">

<head>
<title>
ホームページのタイトル
</title>
<meta http-equiv="CONTENT-TYPE" content="text/html; CHARSET=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="body.css">
</head>

<body>
<center>
<!-- コンテナ開始 -->
<div id="container">
</center>

<!-- ヘッダ開始 -->
<div id="header">
ヘッダ
</div>
<!-- ヘッダ終了 -->

<!-- ナビゲーション開始 -->
<div class="section ">
<div id="nav">
ナビゲーション
</div>
</div>
<!-- ナビゲーション終了 -->

<!-- メインカラム開始 -->
<div id="content">
メイン
</div>

<!-- メインカラム終了 -->
<!-- フッタ開始 -->
<div id="footer">
フッタ
</div>

<!-- フッタ終了 -->
</div>
<!-- コンテナ終了 -->

</body>
</html>



CSSタグ
@charset "Shift_JIS";

/* --- 全体の背景・テキスト --- */
body {
margin: 0;
padding: 0;
background-color: #ffffff; /* ページの背景 */
color: #000000; /* 全体の文字色 */
font-size: 100%; /* 全体の文字サイズ */
}

/* --- 全体のリンクテキスト --- */
a:link { color: #0000ff; }
a:visited { color: #3DAF5F; }
a:hover { color: #66CCFF; }
a:active { color: #336699; }

/* --- コンテナ --- */
#container {
width: 80%; /* ページの幅 */
margin: 0 auto; /* センタリング */
background-color: #ffffff; /* メインカラムの背景 */
border-left: 1px #BFBFFF solid; /* 左枠線 */
border-right: 1px #BFBFFF solid; /* 右枠線 */
}

/* --- ヘッダ --- */
#header {
background-color: #faebd7; /* ヘッダの背景 */
}

/* --- ナビゲーション --- */
#nav {
float: right;
width: 200px; /* サイドバーの幅 */
background-color: #cccccc; /* ナビゲーションの背景 */
}

/* --- メインカラム --- */
#content {
margin-right: 200px; /* メインカラムの右マージン */
}

/* --- フッタ --- */
#footer {
clear: right; /* フロートのクリア */
width: 100%;
background-color: #faebd7; /* フッタの背景 */
}

inserted by FC2 system