网页布局通常分为多个列。
然后将这些列视为不同的数据部分。
有两种最流行的方法可以在 html 页面中创建这些列。
一种方法是使用 <div>标签,另一种方法是使用 HTML 的 <table>标签。
大多数网站布局都有一个公共标题区域,我们其中放置网站徽标或者标语(有时还有菜单)。
然后我们将主要内容部分分为两列或者三列。
网页底部包含一个常见的页脚部分,我们可以其中放置徽标、版权声明、菜单或者其他一些内容。
在两列中,我们有一个左侧或者右侧边列区域和一个内容区域。
在三列页面设计中,我们有左侧边列区域、主要内容区域和右侧边列区域。
使用表格标签创建 HTML 页面布局
让我们使用 HTML 表格创建一个两列布局以及页眉和页脚区域。
<!DOCTYPE html>
<html>
<head>
<title>Basic HTML Layout using Tables</title>
</head>
<body>
<table width="90%" border="1" align="center">
<tr>
<td colspan="2" bgcolor="green">
<h1>Website Title or Tagline</h1>
</td>
</tr>
<tr valign="top">
<td bgcolor="lightblue" width="30%">
Fruit Menu
Orange<br />
Banana<br />
Apple<br />
Grapes
</td>
<td bgcolor="orange" width="60%" height="200">
This is the main content area.
</td>
</tr>
<tr>
<td colspan="2" bgcolor="skyblue" align="center">
Copyright © 2017 onitroad.com
</td>
</tr>
</table>
</body>
</html>
日期:2020-09-17 00:10:58 来源:oir作者:oir
