上图代码:
<!DOCTYPE html>
<html>
<body>
<div id="container" style="width:500px">
<div id="header" style="background-color:#FFA500;">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
<div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
<b>Menu</b><br>
HTML<br>
CSS<br>
JavaScript</div>
<div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">
Content goes here</div>
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
Copyright @ W3CSchool.cc<br />
Copyright @ W3CSchool.cc</div>
</div>
</body>
</html>
使用表格标签可达到同样效果
<table width="500" border="0">
<!-- <tr>
<td style="background-color:grey;">DDLS</td>
</tr> -->
<tr>
<td colspan="2" style="background-color:#FFA500;">
<h1>Main Title of Web Page</h1>
</td>
</tr>
<tr>
<td style="width:100px;background-color:red">
<b>Menu</b><br />
html<br />
CSS <br />
</td>
<td style="background-color:grey;height:100px;">
CAA
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#FFA500;text-align:center;">
Copyright @ W3CSchool.cc
</td>
</tr>
</table>
阅读(858) | 评论(0) | 转发(0) |