floatを使ったレイアウト
制作したもの
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>【確認テスト05月14日】</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
ul {
list-style-type: none;
}
img {
border: none;
}
body {
color: #FFF;
font-size: 1.0em;
font-family:
"ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro",
"メイリオ",
Meiryo,
Osaka,
"MS Pゴシック",
"MS PGothic",
sans-serif;
background-color: #CCC;
}
#container {
width: 800px;
height: auto;
margin: 0 auto;
padding: 10px;
background-color: #FFF;
overflow: hidden;
}
#header {
width: auto;
height: 100px;
margin: 0 0 10px 0;
background-color: #A3BED5;
}
h1 {
color: #FFF;
font-size: 1.7em;
font-family: serif;
padding: 20px 0 0 20px;
}
#content {
float: right;
width: 540px;
height: 290px;
margin: 0 0 10px 0;
padding: 10px;
background-color: #DCD78A;
}
#sidebar {
float: left;
width: 200px;
height: auto;
padding: 10px 10px 0 10px;
background-color: #9CC56E;
}
#sidebar li {
height: 80px;
margin: 0 0 10px 0;
}
#footer {
clear: both;
width: auto;
height: 50px;
background-color: #E0B9D2;
}
address {
font-style: normal;
text-align: center;
padding: 15px 0 0 0;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>ここにサイトタイトルが入る</h1>
</div>
<div id="wrapper">
<div id="content">
<h2>ここに見出しが入る</h2>
<p>ここに本文が入る</p>
</div>
<div id="sidebar">
<ul>
<li><img src="images/banner.jpg" width="200" height="80" alt="バナー1" /></li>
<li><img src="images/banner.jpg" width="200" height="80" alt="バナー2" /></li>
<li><img src="images/banner.jpg" width="200" height="80" alt="バナー3" /></li>
</ul>
</div>
</div>
<div id="footer">
<address>ここに連絡先のテキストが入る</address>
</div>
</div>
</body>
</html>