HTML
来源:互联网 发布:猪八戒的真实实力知乎 编辑:程序博客网 时间:2024/05/21 22:37
Basic tags
基 本 标 签
<html></html>
Creates an HTML document
创 建 一个HTML 文档
<head></head>
Sets off the title and other
information that isn't displayed
on the Web page itself
设 置 文 档标 题 以 及其 他 不在WEB 网页 上 显 示的 信 息
<body></body>
Sets off the visible portion of
the document
设 置 文 档的 可 见 部分
Header tags
标 题 标 签
<title></title>
Puts the name of the document
in the title bar
将 文 档 的题 目 放 在标 题 栏 中
Body attributes
文 档 整 体属 性
<body bgcolor=?>
Sets the background color,
using name or hex value
设 置 背 景颜 色, 使用 名 字 或十 六 进 制值
<body text=?>
Sets the text color, using
name or hex value
设 置 文 本文 字 颜色, 使 用名 字 或 十六 进 制 值
<body link=?>
Sets the color of links,
using name or hex value
设 置 链 接颜 色, 使用 名 字 或十 六 进 制值
<body vlink=?>
Sets the color of followed
links, using name or hex value
设 置 已 使用 的 链 接的 颜 色,使 用 名 字或 十 六 进制 值
<body alink=?>
Sets the color of links on click
设 置 正 在被 击 中 的链 接 的 颜色, 使 用名 字 或 十六 进 制 值
Text tags
文 本 标 签
<pre></pre>
Creates preformatted text
创 建 预 格式 化 文 本
<h1></h1>
Creates the largest headline
创 建 最 大的 标 题
<h6></h6>
Creates the smallest headline
创 建 最 小的 标 题
<b></b>
Creates bold text
创 建 黑 体字
<i></i>
Creates italic text
创 建 斜 体字
<tt></tt>
Creates teletype, or
typewriter-style text
创 建 打 字机 风 格 的字 体
<cite></cite>
Creates a citation, usually
italic
创 建 一 个引 用, 通常 是 斜 体
<em></em>
Emphasizes a word (with italic
or bold)
加 重 一 个单 词( 通常 是 斜 体加 黑 体)
<strong></strong>
Emphasizes a word (with italic
or bold)
加 重 一 个单 词( 通常 是 斜 体加 黑 体)
<font size=?></font>
Sets size of font, from 1 to 7
设 置 字 体大 小, 从 1到 7
<font color=?></font>
Sets font color, using name or
hex value
设 置 字 体的 颜 色,使 用 名 字或 十 六 进制 值
Links
链 接
<a href="URL"></a>
Creates a hyperlink
创 建 一 个超 链 接
<a href="mailto:EMAIL">
</a>
Creates a mailto link
创 建 一 个自 动 发 送电 子 邮 件的 链 接
<a name="NAME"></a>
Creates a target location within
a document
创 建 一 个位 于 文 档内 部 的 靶位
<a href="#NAME"></a>
Links to that target location
from elsewhere in the document
创 建 一 个指 向 位 于文 档 内 部靶 位 的 链接
Formatting
格 式 排 版
<p>
Creates a new paragraph
创 建 一 个新 的 段 落
<p align=?>
Aligns a paragraph to the left,
right, or center
将 段 落 按左、 中、 右对 齐
<br>
Inserts a line break
插 入 一 个回 车 换 行符
<blockquote>
</blockquote>
Indents text from both sides
从 两 边 缩进 文 本
<dl></dl>
Creates a definition list
创 建 一 个定 义 列 表
<dt>
Precedes each definition term
放 在 每 个定 义 术 语词 之 前
<dd>
Precedes each definition
放 在 每 个定 义 之 前
<ol></ol>
Creates a numbered list
创 建 一 个标 有 数 字的 列 表
<li>
Precedes each list item, and adds
a number
放 在 每 个数 字 列 表项 之 前,并 加 上 一个 数 字
<ul></ul>
Creates a bulleted list
创 建 一 个标 有 圆 点的 列 表
<li>
Precedes each list item, and adds
the bullet
放 在 每 个圆 点 列 表项 之 前,并 加 上 一个 圆 点
<div align=?>
A generic tag used to format large
blocks of HTML, also used for
stylesheets
一 个 用 来排 版 大块HTML 段落 的 标签, 也 用于 格 式 化表
Graphical elements
图 形 元 素
<img src="name">
Adds an image
添 加 一 个图 像
<img src="name" align=?>
Aligns an image: left, right,
center; bottom, top, middle
排 列 对 齐一 个 图像: 左 中右 或 上 中下
<img src="name" border=?>
Sets size of border around an
image
设 置 围 绕一 个 图 像的 边 框 的大 小
<hr>
Inserts a horizontal rule
加 入 一 条水 平 线
<hr size=?>
Sets size (height) of rule
设 置 水 平线 的 大 小( 高 度)
<hr width=?>
Sets width of rule, in percentage
or absolute value
设 置 水 平线 的 宽 度( 百 分 比或 绝 对 像素 点)
<hr noshade>
Creates a rule without a shadow
创 建 一 个没 有 阴 影的 水 平 线
Tables
表 格
<table></table>
Creates a table
创 建 一 个表 格
<tr></tr>
Sets off each row in a table
开 始 表 格中 的 每 一行
<td></td>
Sets off each cell in a row
开 始 一 行中 的 每 一个 格 子
<th></th>
Sets off the table header (a
normal cell with bold, centered
text)
设 置 表 格头: 一 个通 常 使 用黑 体 居 中文 字 的 格子
Table attributes
表 格 属 性
<table border=#>
Sets width of border around
table cells
设 置 围 绕表 格 的 边框 的 宽 度
<table cellspacing=#>
Sets amount of space between table
cells
设 置 表 格格 子 之 间空 间 的 大小
<table cellpadding=#>
Sets amount of space between a
cell''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''s border and its contents
设 置 表 格格 子 边 框与 其 内 部内 容 之 间空 间 的 大小
<table width=# or %>
Sets width of table - in pixels
or as a percentage of document width
设 置 表 格的 宽 度-用 绝 对 像素 值 或 文档 总 宽 度的 百 分 比
<tr align=?> or <td align=?>
Sets alignment for cell(s) (left,
center, or right)
设 置 表 格格 子 的 水平 对 齐(左 中 右)
<tr valign=?> or <td valign=?>
Sets vertical alignment for cell(s)
(top, middle, or bottom)
设 置 表 格格 子 的 垂直 对 齐(上 中 下)
<td colspan=#>
Sets number of columns a cell should
span (default=1)
设 置 一 个表 格 格 子应 跨 占 的列 数( 缺省 为 1)
<td rowspan=#>
Sets number of rows a cell should
span (default=1)
设 置 一 个表 格 格 子应 跨 占 的行 数( 缺省 为 1)
<td nowrap>
Prevents the lines within a cell
from being broken to fit
禁 止 表 格格 子 内 的内 容 自 动断 行 回 卷
Frames
窗 框
<frameset></frameset>
Precedes the <body> tag in a frames document; can also be nested in other framesets
放 在 一 个窗 框 文 档的 <body>标 签 之前,也 可 以嵌 在 其 他窗 框 文 档中
<frameset rows="value,value">
Defines the rows within a frameset,
using number in pixels, or percentage
of width
定 义 一 个窗 框 内 的行 数, 可以 使 用 绝对 像 素 值或 高 度 的百 分 比
<frameset cols="value,value">
Defines the columns within a frameset, using number in pixels, or percentage
of width
定 义 一 个窗 框 内 的列 数, 可以 使 用 绝对 像 素 值或 宽 度 的百 分 比
<frame>
Defines a single frame - or region - within a frameset
定 义 一 个窗 框 内 的单 一 窗 或窗 区 域
<noframes></noframes>
Defines what will appear on browsers
that don''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''t support frames
定 义 在 不支 持 窗 框的 浏 览 器中 显 示 什么 提 示
Frames attributes
窗 框 属 性
<frame src="URL">
Specifies which HTML document should
be displayed
规 定 窗 框内 显 示 什么HTML 文档
<frame name="name">
Names the frame, or region, so it may
be targeted by other frames
命 名 窗 框或 区 域 以便 别 的 窗框 可 以 指向 它
<frame marginwidth=#>
Defines the left and right margins for the frame; must be equal to or greater than 1
定 义 窗 框左 右 边 缘的 空 白 大小, 必 须大 于 等 于1
<frame marginheight=#>
Defines the top and bottom margins for the frame; must be equal to or greater than 1
定 义 窗 框上 下 边 缘的 空 白 大小, 必 须大 于 等 于1
<frame scrolling=VALUE>
Sets whether the frame has a scrollbar; value may equal "yes," "no," or "auto." The default, as in ordinary documents,
is auto.
设 置 窗 框是 否 有 滚动 栏, 其值 可 以 是"yes", "no", "auto", 缺省 时 一 般为 "auto"
<frame noresize>
Prevents the user from resizing a frame
禁 止 用 户调 整 一 个窗 框 的 大小
Forms
表 单
For functional forms, you''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''ll have to run a CGI script. The HTML just creates the appearance of a form.
对 于 功 能性 的 表单,一 般 需要 运 行 一个 CGI 小程序,HTML仅仅 是产 生表 单 的 表面 样 子。
<form></form>
Creates all forms
创 建 所 有表 单
<select multiple name="NAME" size=?></select>
Creates a scrolling menu. Size sets the number of menu items visible before you need to scroll.
创 建 一 个滚 动 菜单,size 设置 在 需 要滚 动 前 可以 看 到 的表 单 项 数目
<option>
Sets off each menu item
设 置 每 个表 单 项 的内 容
<select name="NAME"></select>
Creates a pulldown menu
创 建 一 个下 拉 菜 单
<option>
Sets off each menu item
设 置 每 个菜 单 项 的内 容
<textarea name="NAME" cols=40 rows=8></textarea>
Creates a text box area. Columns set the width; rows set the height.
创 建 一 个文 本 框 区域,列 的 数目 设 置 宽度,行 的 数目 设 置 高度
<input type="checkbox" name="NAME">
Creates a checkbox. Text follows tag.
创 建 一 个复 选 框,文字 在 标 签后 面
<input type="radio" name="NAME" value="x">
Creates a radio button. Text follows
tag
创 建 一 个单 选 框,文字 在 标 签后 面
<input type=text name="foo" size=20>
Creates a one-line text area. Size
sets length, in characters.
创 建 一 个单 行 文 本输 入 区域,size 设置 以 字 符计 的 宽 度
<input type="submit" value="NAME">
Creates a Submit button
创 建 一 个submit(提交)按 钮
<input type="image" border=0 name="NAME" src="name.gif">
Creates a Submit button using an image
创 建 一 个使 用 图 象的submit(提交)按 钮
<input type="reset">
Creates a Reset button