9.表格
标签 | 描述 |
---|---|
<table> | 定义表格 |
<caption> | 定义表格标题。 |
<th> | 定义表格中的表头单元格。 |
<tr> | 定义表格中的行。 |
<td> | 定义表格中的单元。 |
<thead> | 定义表格中的表头内容。 |
<tbody> | 定义表格中的主体内容。 |
<tfoot> | 定义表格中的表注内容(脚注)。 |
<col> | 定义表格中一个或多个列的属性值。 |
<colgroup> | 定义表格中供格式化的列组。 |
<table width="400" border="1">
<tr>
<th align="left">消费项目....</th>
<th align="right">一月</th>
<th align="right">二月</th>
</tr>
<tr>
<td align="left">衣服</td>
<td align="right">$241.10</td>
<td align="right">$50.20</td>
</tr>
<tr>
<td align="left">化妆品</td>
<td align="right">$30.00</td>
<td align="right">$44.45</td>
</tr>
<tr>
<td align="left">食物</td>
<td align="right">$730.40</td>
<td align="right">$650.00</td>
</tr>
<tr>
<th align="left">总计</th>
<th align="right">$1001.50</th>
<th align="right">$744.65</th>
</tr>
</table>
10.样式/节
<table width="400" border="1">
<tr>
<th align="left">消费项目....</th>
<th align="right">一月</th>
<th align="right">二月</th>
</tr>
<tr>
<td align="left">衣服</td>
<td align="right">$241.10</td>
<td align="right">$50.20</td>
</tr>
<tr>
<td align="left">化妆品</td>
<td align="right">$30.00</td>
<td align="right">$44.45</td>
</tr>
<tr>
<td align="left">食物</td>
<td align="right">$730.40</td>
<td align="right">$650.00</td>
</tr>
<tr>
<th align="left">总计</th>
<th align="right">$1001.50</th>
<th align="right">$744.65</th>
</tr>
</table>
标签 | 描述 |
---|---|
<style> | 定义文档的样式信息。 |
<div> | 定义文档中的节。<div> 是一个块级元素。 |
<span> | 定义文档中的节。<span> 来组合行内元素 |
<style type="text/css">
h1 {color:red} p {color:blue}</style>
<link rel="stylesheet" type="text/css" href="/html/csstest1.css" >
class 用于元素组(类似的元素,或者可以理解为某一类元素),而 id 用于标识单独的唯一的元素。
11.元信息
标签 | 描述 |
---|---|
<head> | 定义关于文档的信息。 |
<meta> | 定义关于 HTML 文档的元信息。 |
<base> | 定义页面中所有链接的默认地址或默认目标。 |
<basefont> | 不赞成使用。定义页面中文本的默认字体、颜色或尺寸。 |
<head> 标签用于定义文档的头部
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 把 content 属性关联到 HTTP 头部。
<meta http-equiv="Content-Language" content="zh-cn" />
<base target="_blank" /> base 标签使页面中的所有标签在新窗口中打开。
<title>标题不会显示在文档区</title> 文档的标题
</head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 把 content 属性关联到 HTTP 头部。
<meta http-equiv="Content-Language" content="zh-cn" />
<base target="_blank" /> base 标签使页面中的所有标签在新窗口中打开。
<title>标题不会显示在文档区</title> 文档的标题
</head>
<meta> 元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词
<meta name="keywords"
content="HTML,ASP,PHP,SQL"> 把 content 属性关联到一个名称
<meta name="author" content="w3school.com.cn"> 标识了创作者
<metahttp-equiv="charset"
content="iso-8859-1"> <metahttp-equiv="expires"
content="31 Dec 2008">
<meta http-equiv="Refresh" content="5;url=http://www.w3school.com.cn" /> 5 秒内被重定向到新的地址
content 属性始终要和 name 属性或 http-equiv 属性一起使用。
<base href="http://www.w3school.com.cn/i/" /> head 部分规定了一个基准 URL
12.编程
标签 | 描述 |
---|---|
<script> | 定义客户端脚本。 |
<noscript> | 定义针对不支持客户端脚本的用户的替代内容。 |
<applet> | 不赞成使用。定义嵌入的 applet。 |
<embed> | 为外部应用程序(非 HTML)定义容器。 |
<object> | 定义嵌入的对象。 |
<param> | 定义对象的参数。 |
<script> 标签用于定义客户端脚本,
<script type="text/javascript">
document.write("<h1>Hello World!</h1>")
</script>
浏览器从服务器上下载js文件 定义外部脚本文件中所使用的字符编码:告诉浏览器用来编码这个 javascript 程序的字符集
<script type="text/javascript" src="myscripts.js" charset="UTF-8"
></script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>