由于明天要考试今天就没有学习新知识,所以只是试着不看课件写一下一个非常简单的代码,才知道看起来很简单的东西也会犯错误,自己试一下后觉得在以后的学习中会看到更多的细节,提高学习效率。这是我的今天的学习收获,希望大家在学习往后也保持这经常课后练习的习惯。
今天写得是一个非常简单的代码,如下:
<html>
<head>
<title>training Page layout</title>
</head>
<body topmargin="0">
<table border="1px" width="960" align="center" cellpadding="0" cellspacing="0" >
<tr height="90" bgcolor="orange" align="center"><td><font size="6" color="white"><b>页面一</b></font></td></tr>
<!--在某些浏览器中border="0"是不会出现边框的,所以这里写border="1"-->
<tr>
<td>
<table width="30%" height="400" border="" align="left" cellpadding="0" cellspacing="0">
<tr align="center" bgcolor="sky blue">
<td><font size="5" color="green"><b>页面二</b></font></td>
</tr>
</table>
<table width="70%" height="400" border="" align="left" cellpadding="0" cellspacing="0">
<tr align="center" bgcolor="pink">
<!--<table>嵌套中嵌套的<table>是在<tr><td></tr></td>里面的,否则就会脱离嵌套-->
<td><font size="5" color="purple"><b>页面三</b></font></td>
</tr>
</table>
</td>
</tr>
<tr height="90" bgcolor="prasinous" align="center">
<!--在<tr>,<th>,<td>中align控制的是文字的位置,而在<table>中align控制的是表格在网页上的位置-->
<td><font size="6" color="orange"><b>页面四</b></font></td>
</tr>
</table>
</body>
</html>
希望你们看了也有用,生活愉快。