HTML布局
网页布局对改善网络的外观非常重要。
<html>
<head lang="en">
<meta charset="UTF-8">
<title>NEWS</title>
<style type="text/css">
div#container
{
width: 500px;
}
div#header
{
background-color:#99bbbb;
}
div#menu
{
background-color:#ffff99;
height: 200px;
width: 100px;
float: left;
}
div#content
{
background-color: #eeeeee;
height: 200px;
width: 400px;
float: left;
}
div#footer
{
background-color: #99bbbb;
clear: both;
text-align: center;
}
h1
{
margin-bottom: 0;
}
h2
{
margin-bottom: 0;
font-size: 18px;
}
ul
{
margin: 0;
font-size: 12px;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>Main Title of Web Page</h1>
</div>
<div id="menu">
<h2>Menu</h2>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div>
<div id="content">Content goes here</div>
<div id="footer">Copyright limin.com.cn</div>
</div>
</body>
</html>
在浏览器中显示的样式: