两声鸟鸣 2008-3-30 11:07 PM
html代码集
请无视那些序号…………它们是乱来的……一开始很认真得填代码,后来就懒了……一空行一种代码……
因为好像9x并不支持在帖子里用html代码,所以效果就展示不了了。
[color=red][size=16px]另外,请问有谁知道让文字闪光的代码[/size]……[/color]
HTML 文件结构(Document Structures)
[b]以下是代码:[/b]
[list=1][*]<html>...</html>[*]<head>...</head>[*]<body>...</body>[*]<HTML>[*]<HEAD>[*] <title>, <base>, <link>, <isindex>, <meta>[*]</HEAD>[*]<BODY>[*] HTML 文件的正文写在这里... ...[*]</BODY>[*]</HTML>[/list]
语言字符集(Charsets)的信息
[b]以下是代码:[/b]
[list=1][*]<meta http-equiv="Content-Type" c>[*][*]#=[*]us-ascii, iso-8859-1, x-mac-roman, iso-8859-2, x-mac-ce,[*]iso-2022-jp, x-sjis, x-euc-jp,[*]euc-kr, iso-2022-kr,[*]gb2312, gb_2312-80,[*]x-euc-tw, x-cns11643-1, x-cns11643-2, big5[*][/list]
可在 HTML 文件中设置 MIME 字符集信息。
您在浏览主页时,最好自己在浏览器的选项菜单内选择相应的语言(language encoding)。
但是如果 HTML 文件里写明了设置,浏览器就会自动设置语言选项。
尤其是主页里用到了字符实体(entities),则该主页就应该写明字符集信息。
否则,您在浏览该主页时,若未正确设置语言选项,显示将可能混乱。
背景色彩和文字色彩
[b]以下是代码:[/b]
[list=1][*]<body bgcolor=# text=# link=# alink=# vlink=#>[/list]
bgcolor --- 背景色彩
text --- 非可链接文字的色彩
link --- 可链接文字的色彩
alink --- 正被点击的可链接文字的色彩
vlink --- 已经点击(访问)过的可链接文字的色彩
#=rrggbb
色彩是用 16 进制的 红-绿-蓝(red-green-blue, RGB) 值来表示。
16 进制的数码有: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f.
背景图象
[b]以下是代码:[/b]
[list=1][*]<body background="image-URL">[*]Non Scrolling Background <body bgproperties=FIXED>[/list]
页面空白(Margin)
页面左边的空白
[b]以下是代码:[/b]
[list=1][*]<body leftmargin=#>[/list]
页面上方的空白(天头)
[b]以下是代码:[/b]
[list=1][*]<body topmargin=#> #=margin amount[/list]
链接(Link)
基本语法
[b]以下是代码:[/b]
[list=1][*]<a href=http://www.9xfan.net/bbs/index.php> ... </a>这是一个<a href="samp/link.html">链接的例子</a>。[/list]
点一下带下划线的文字!
这是一个[url=http://www.9xfan.net/][color=#0000ff]链接的例子[/color][/url]。 点一下带下划线的文字!
开一个新的(浏览器)窗口 (Target Window)
[b]以下是代码:[/b]
[list=1][*]<a href="URL" target="Window_Name"> ... </a>[*]<a href="samp/window.html" target="window_name">[*]</a>[/list]
标尺线
[b]以下是代码:[/b]
[list=1][*]<hr>[*]<hr size=#>[*]<hr size=10>[*]<hr width=#>[*]<hr width=50>[*]<hr width=50%>[*]<hr align=#> #=left, right[*]<hr width=50% align=left>[*]<hr width=50% align=right>[*]<hr noshade>[*]<hr noshade>[*]<hr color=#>[*]#=rrggbb 16 进制 RGB 数码,或者是下列预定义色彩:[*]Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,[*]Fuchsia, White, Green, Purple, Silver, Yellow, Aqua[*]<hr color="red">[/list]
标题字体(Header)
[b]以下是代码:[/b]
[list=1][*]<h#> ... </h#>[/list]
#=1, 2, 3, 4, 5, 6
<hn>---</hn> 这些标记显示黑体字。
<hn>---</hn> 这些标记自动插入一个空行,不必用 <p> 标记再加空行。
因此在一行中无法使用不同大小的字体。
字体大小
[b]以下是代码:[/b]
[list=1][*]<font size=#> ... </font>[/list]
#=1, 2, 3, 4, 5, 6, 7 or +#, -#
[b]以下是代码:[/b]
[list=1][*]<basefont size=#>[/list]
#=1, 2, 3, 4, 5, 6, 7
物理字体(Physical Style)
[b]以下是代码:[/b]
[list=1][*]<b>加粗</b>[*]<i>打斜</i>[*]<u>下划线</u>[*]<s>去除线</s>[/list]
指定“字体大小”的标记和“指定字体”的标记的组合使用
[b]以下是代码:[/b]
[list=1][*]<i><font size=5>[*] <b>今天</b> 天气<font size=6> 真好!</font>[*]</font></i>[/list]
字体颜色
指定颜色
[b]以下是代码:[/b]
[list=1][*]<font color=#> ... </font>[/list]
#=rrggbb 16 进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
文字的对齐(Alignment)
[b]以下是代码:[/b]
[list=1][*]<hn align=#>...</hn>[*]<p align=#>...</p> #=left, center, right[*]<h3 align=center>Hello<\h3>[*]<h3 align=right>Hello<\h3>[*][/list]
预格式化文本(Preformatted Text)
[b]以下是代码:[/b]
[list=1][*]<pre>...</pre>[*]<pre>[*]Please use your card.[*]VISA Master[*]<b>Here is an order form.</b>[*]<ul><li>Fax[*]<li>Air Mail</ul>[*]</pre>[*]Please use your card[*]VISA Master[*]Here is an order form.[*]Fax[*]Air Mail[*]<listing>...</listing>[*]<listing>[*]Please use your card.[*]VISA Master[*]<b>Here is an order form.</b>[*]<ul><li>Fax[*]<li>Air Mail</ul>[*]</listing>[*]Please use your card.[*]VISA Master[*]Here is order form.[*]Fax[*]Air Mail[*]<xmp>...</xmp>[*]<xmp>[*]Please use your card.[*]VISA Master[*]<b>Here is an order form.</b>[*]<ul><li>Fax[*]<li>Air Mail</ul>[*]</xmp>[*]Please use your card.[*]VISA Master[*]<b>Here is order form.</b>[*]<ul><li>Fax[*]<li>Air Mail</ul>[/list]
空白(Spacer)
[b]以下是代码:[/b]
[list=1][*]<spacer type="horizontal" size=#>[/list]
#=水平空白宽度
[b]以下是代码:[/b]
[list=1][*]<spacer type="vertical" size=#>[/list]
#=竖直空白高度
闪烁
[b]以下是代码:[/b]
[list=1][*]<blink>...</blink>[/list]
链入图象的基本语法
[b]以下是代码:[/b]
[list=1][*]<img src=#>[/list]
#=图象的 URL
[b]以下是代码:[/b]
[list=1][*]<img alt=#>[/list]
#=在浏览器尚未完全读入图象时,在图象位置显示的文字。
图象和文字的对齐
[b]以下是代码:[/b]
[list=1][*]<img align=#>[/list]
#=top, middle, bottom
边框
[b]以下是代码:[/b]
[list=1][*]<img border=#>[/list]
#=value
基本语法
表单的基本语法
[b]以下是代码:[/b]
[list=1][*]<form action="url" method=*>[*]...[*]...[*]<input type=submit> <input type=reset>[*]</form>[/list]
*=GET, POST
表单中提供给用户的输入形式
[b]以下是代码:[/b]
[list=1][*]<input type=* name=**>[/list]
*=text, password, checkbox, radio, image, hidden, submit, reset
**=Symbolic Name for CGI script
文字输入和密码输入
*=text, password
<input type=*>
<input type=* value=**>
例:
<form action=/cgi-bin/post-query method=POST>
您的姓名:
<input type=text name=姓名><br>
您的主页的网址:
<input type=text name=网址 value=http://><br>
密码:
<input type=password name=密码><br>
<input type=submit value="发送"><input type=reset value="重设">
</form>
<input type=* size=**>
<input type=* maxlength=**>
<form action=/cgi-bin/post-query method=POST>
<input type=text name=a01 size=40><br>
<input type=text name=a02 maxlength=5><br>
<input type=submit><input type=reset>
</form>
复选框(Checkbox) 和 单选框(RadioButton)
<input type=checkbox>
<input type=checkbox checked>
<input type=checkbox value=**>
<input type=radio value=**>
<input type=radio value=** checked>
列表框(Selectable Menu)
基本语法
<select name=*>
<option> ...
</select>
<option selected>
<option value=**>
<select size=**>
<select size=** multiple>
注意,是用 Ctrl 键配合鼠标实现多选。
(和 MS-WINDOWS 的 File Manager 一样)
文本区域
<textarea name=* rows=** cols=**> ... <textarea>
对于很长的行是否进行换行的设置(Word Wrapping)
<textarea wrap=off> ... </textarea>
不换行,是缺省设置。
<textarea wrap=soft> ... </textarea>
“软换行”,好象 MS-WORD 里的“软回车”。
<textarea wrap=hard> ... </textarea>
“硬换行”,好象 MS-WORD 里的“硬回车”。
跨多行、多列的表元(Table Span)
表格的基本语法
<table>...</table> - 定义表格
<tr> - 定义表行
<th> - 定义表头
<td> - 定义表元(表格的具体数据)
带边框的表格:
<table border>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
跨多列的表元 <th colspan=#>
<table border>
<tr><th colspan=3> Morning Menu</th>
<tr><th>Food</th> <th>Drink</th> <th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
跨多行的表元 <th rowspan=#>
<table border>
<tr><th rowspan=3> Morning Menu</th>
<th>Food</th> <td>A</td></tr>
<tr><th>Drink</th> <td>B</td></tr>
<tr><th>Sweet</th> <td>C</td></tr>
</table>
表格尺寸设置
<table border=#>
边框尺寸设置:
<table border=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
<table border width=# height=#>
表格尺寸设置:
<table border width=170 height=100>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
<table border cellspacing=#>
表元间隙设置:
<table border cellspacing=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
<table border cellpadding=#>
表元内部空白设置:
<table border cellpadding=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
表格内文字的对齐/布局
<tr align=#>
<th align=#> #=left, center, right
<td align=#>
<table border width=160>
<tr>
<th>Food</th><th>Drink</th><th>Sweet</th>
<tr>
<td align=left>A</td>
<td align=center>B</td>
<td align=right>C</td>
</table>
<tr valign=#>
<th valign=#> #=top, middle, bottom, baseline
<td valign=#>
<table border height=100>
<tr>
<th>Food</th><th>Drink</th>
<th>Sweet</th><th>Other</th>
<tr>
<td valign=top>A</td>
<td valign=middle>B</td>
<td valign=bottom>C</td>
<td valign=baseline>D</td>
</table>
表格在页面中的对齐/布局(Floating Table)
<table align=left>
<table align="left" border>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
My favorites...<br>
cookies, chocolates, and more.
table align=right>
Food Drink Sweet
A B C
My favorites...
cookies, chocolates, and more.
<table vspace=# hspace=#> #=space value
<table align="left" border vspace=20 hspace=30>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
My favorites...<br>
表格的标题
<caption align=#> ... </caption> #=left, center, right
<table border>
<caption align=center>Lunch</caption>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
<caption valign=#> ... </caption> #=top, bottom
valign=top is default.
<table border>
<caption valign=bottom>Lunch</caption>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
表格的色彩
表元的背景色彩和背景图象
<th bgcolor=#>
<th background="URL">
表格边框的色彩
<table bordercolor=#>
表格边框色彩的亮度控制
<table bordercolorlight=#>
<table bordercolordark=#>
#=rrggbb 16 进制 RGB 数码, 或者是下列预定义色彩名称:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
表格的分组显示(Structured Table)
按行分组
<thead> ... </thead>
- 表的题头
<tbody> ... </tbody>
- 表的正文
<tfoot> ... </tfoot>
按列分组
<colgroup align=#>
#=left, right, center
列的属性控制
<col span=#>
#=从左数起,具有指定属性的列的列数
<col align=#>
#=left, right, center
多窗口页面基本语法
<frameset> ... </frameset>
<frame src="url">
<noframes> ... </noframes>
各窗口的尺寸设置
<frameset cols=#>
特殊的 4 类操作(很有用!)
<a href=url target=_blank> 新窗口
<a href=url target=_self> 本窗口
<a href=url target=_parent> 父窗口
<a href=url target=_top> 整个浏览器窗口
边框色彩
<frameset bordercolor=#>
#=rrggbb 16 进制 RGB 数码, 或者是下列预定义色彩名称:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua