Rujukan cepat HTML

Rujukan cepat HTML dari CodeW3C.com. Boleh dicetak untuk penggunaan harian.

Dokumen dasar HTML

<html>
<head>
<title>Nama dokumen disini</title>
</head>
<body>
Teks yang dapat dilihat disini
</body>
</html>

Elemen teks

<p>Ini adalah paragraf</p>
<br> (break bar)
<hr> (garisan horizontal)
<pre>Teks ini adalah format sebelumnya</pre>

Gaya Logikal

<em>Teks ini adalah dihighlightkan</em>
<strong>Teks ini adalah kuat</strong>
<code>Ini adalah kod komputer</code>

Gaya Fizikal

<b>Teks ini adalah tebal</b>
<i>Teks ini adalah italik</i>

Link, Anchor, Elemen Imej

<a href="http://www.example.com/">Ini adalah Link</a>
<a href="http://www.example.com/"><img src="URL"
alt="Teks Gantian"></a>
<a href="mailto:webmaster@example.com">Hantar e-mel</a>Anchor yang dinamakan:
<a name="tips">Seksyen Tips yang Berguna</a>
<a href="#tips">Lompat ke Seksyen Tips yang Berguna</a>

无序列表

<ul>
<li>First item</li>
<li>Next item</li>
</ul>

有序列表

<ol>
<li>First item</li>
<li>Next item</li>
</ol>

定义列表

<dl>
<dt>First term</dt>
<dd>Definition</dd>
<dt>Next term</dt>
<dd>Definition</dd>
</dl>

表格

<table border="1">
<tr>
  <th>someheader</th>
  <th>someheader</th>
</tr>
<tr>
  <td>sometext</td>
  <td>sometext</td>
</tr>
</table>

框架

<frameset cols="25%,75%">
  <frame src="page1.htm">
  <frame src="page2.htm">
</frameset>

表单

<form action="http://www.example.com/test.asp" method="post/get">
<input type="text" name="lastname"
value="Nixon" size="30" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit">
<input type="reset">
<input type="hidden">
<select>
<option>Apples
<option selected>Bananas
<option>Cherries
</select>
<textarea name="Comment" rows="60"
cols="20"></textarea>
</form>

Eskema

< adalah sama dengan <
> adalah sama dengan >
© adalah sama dengan ©

Elemen lainnya

<!-- Ini adalah komentar -->
<blockquote>
Teks yang diutamakan dari sumber yang ada.
</blockquote>
<address>
Alamat 1<br>
Alamat 2<br>
Bandar<br>
</address>

Sumber : http://www.codew3c.com/html/html_quick.asp