ウェブ学のすすめ

Study of Web Design & Programing

header部のレイアウト(2)

課題

  • container幅:800px

引用元:復習:header - Webデザインの勉強|忘筌

HTML

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style2.css" type="text/css" media="screen,print">
<title>Information World</title>
</head>
<body>
<!-- ▼#container -->
<div id="container">
<!-- ▼#header -->
<div id="header">
<ul>
<li><a href="#">Internet</a></li>
<li><a href="#">Computer</a></li>
<li><a href="#">Networking</a></li>
<li><a href="#">Database</a></li>
</ul>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input name="textfield" type="text" size="15">
<input type="submit" name="Submit" value="検索">
</form>
<h1>Information World</h1>
</div>
<!-- ▲#header -->
</div>
<!-- ▲#container -->
</body>
</html>

CSS

@charset "UTF-8";

* {
	margin: 0;
	padding: 0;
}
body {
	background-image: url(bg02.jpg);
	background-position: top center;
	background-repeat: no-repeat;
	color: #fff;
}
#container {
	width: 800px;
	height: auto;
	margin: 0 auto;
}
h1 {
	clear:both;
	padding: 10px;
}
ul {
	list-style-type: none;
}
li {
	float: left;
	margin: 0 10px 0;
	font-weight: bold;
}
li a {
	text-decoration: none;
	color: #fff;
}
li a:hover {
	text-decoration: underline;
}
form {
	float: right;
}

正当なCSSです!