<html> <head> <title>Judul page</title> </head> <body> Ini adalah homepage Saya yang pertama. <b>Tulisan ini menggunakan bold</b> </body> </html> Hasilnya:
<h5> Ini contoh dari sebuah heading 5</h5> <h6> Ini contoh dari sebuah heading 6</h6> <p>Gunakan tag heading hanya untuk Heading, jangan gunakan untuk membuat tuliasan supaya menjadi besar. Gunakan tag yang lain untuk keperluan itu.</p> </body> </html> Hasilnya
Line breabk
<html> <body> <p>Untuk memotong <br>baris<br>dalam sebuah<br>paragraph<br>gunakan tag br.</p>
Membuat paragrap
<html> <body> <p>Ini sebuah paragraph baris 1.</p> <p>Ini sebuah paragraph baris 2.</p> <p>Ini sebuah paragraph baris 3.</p> <p>Elemen-elemen Paragraph didefenisikan dengan tag p.</p> </body> </html> Hasilnya
<html> <body> <p> <a href="lastpage.htm"> This text </a> is a link to a page on this Web site. </p> <p> <a href="http://www.microsoft.com/"> This text</a> is a link to a page on the World Wide Web. </p> </body> </html> Hasilnya
Membuat heading
<html> <body> <h1> Ini contoh dari sebuah heading 1</h1> <h2> Ini contoh dari sebuah heading 2</h2> <h3> Ini contoh dari sebuah heading 3</h3> <h4> Ini contoh dari sebuah heading 4</h4> Membuat Link Image <html>
<body> <p> You can also use an image as a link: <a href="lastpage.htm"> <img border="0" src="tblNext.bmp" width="65" height="38"></a> </p> </body> </html> Hasilnya
Hasilnya
Frame
<html> <frameset cols="25%,75%"> <frame src="tryhtml_frame_a.htm"> <frame src="tryhtml_frame_b.htm"> </frameset> </html> Hasilnya
<a href ="tryhtml_frame_a.htm" target ="showframe">Frame a</a><br> <a href ="tryhtml_frame_b.htm" target ="showframe">Frame b</a><br> <a href ="tryhtml_frame_c.htm" target ="showframe">Frame c</a> </body> </html>
</tr> </table> <h4>One row and three columns:</h4> <table border="1"> <tr> <td>100</td> <td>200</td> <td>300</td></tr> </table> <h4>Two rows and three columns:</h4> <table border="1"> <tr> <td>100</td> <td>200</td> <td>300</td></tr> <tr> <td>400</td> <td>500</td> <td>600</td></tr> </table> </body> </html> Hasilnya :
Hasilnya :
<html> <body> <h4>Tabel ini tidak mempunyai border:</h4> <table> <tr><td>100</td><td>200</td><td>300</td></tr> <tr><td>400</td><td>500</td><td>600</td></tr> </table> <h4>Tabel ini tidak mempunyai border, karena nilai atribut= 0 </h4> <table border="0"> <tr> <td>100</td> <td>200</td> <td>300</td></tr> <tr> <td>400</td> <td>500</td> <td>600</td></tr> </table> </body> </html>
<body> <table border="1"> <tr> <td>Some text</td> <td>Some text</td></tr> <tr> <td></td> <td>Some text</td></tr> </table> <p> Seperti yang Anda lihat salah satu Cell tidak punya border. Itu
disebabkan oleh karena isinya kosong. Coba masukkan sebuah space kedalam Cell. Apakah tetap tidak tanpa border ? </p> <p> Trick untuk memasukkan sebuah nobreaking space (" ") kedalam cell. No-breaking space adalah sebuah karakter entity. Bila Anda tidak mengetahui apa yang dimaksud dengan karakter entity, baca penjelasan sebelumnya.
</p> </body> </html>
Hasilnya :
<h4>Vertical headers:</h4> <table border="1"> <tr> <th>First Name:</th> <td>Binsar Siagian</td></tr> <tr> <th>Telephone:</th> <td>6652326</td> </tr> <tr> <th>Telephone:</th> <td>6654486</td> </tr> </table> </body> </html>
Hasilnya :
Hasilnya :
4. Tabel kosong.
<html>
Hasilnya :
Hasilnya :
</body> </html>
Hasilnya :
11. Meluruskan isi (content ) dalam sebuah cell tabel. 9. Menambahkan background color atau background image kedalam sebuah Tabel.
<html> <body> <h4>A background color:</h4> <table border="1" bgcolor="red"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>A background image:</h4> <table border="1" background="background.jpg"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> </body> </html> <html> <body> <table width="400" border="1"> <tr> <th align="left">Tabungan bulan....</th> <th align="right">Januari</th> <th align="right">Februari</th> </tr> <tr> <td align="left">Pakaian</td> <td align="right">Rp. 25.000,-</td> <td align="right">Rp. 17.500,-</td> </tr> <tr> <td align="left">Make-Up</td> <td align="right">Rp. 4.500,-</td> <td align="right">Rp. 8.250,-</td> </tr> <tr> <td align="left">Jajanan</td> <td align="right">Rp. 7.500,-</td> <td align="right">Rp. 2.500,-</td> </tr> <tr> <th align="left">Jumlah</th> <th align="right">Rp. 37.000,-</th> <th align="right">Rp. 28.250,-</th> </tr> </table> </body> </html>
Hasilnya :
Hasilnya : 10. Menambahkan background color atau background image kedalam sebuah Cell tabel.
<html> <body> <h4>Cell backgrounds:</h4> <table border="1"> <tr><td bgcolor="red">First</td><td>Row</td></tr> <tr> <td background="background.jpg">Second</td><td>Row</td> </tr> </table> </body> </html>
Hasilnya :
Bila tidak ada frame diseputar tabel pada contoh ini, berarti browser Anda sudah tertinggal (versi lama tidak mendukung fungsi ini). </p> <h4>With frame="border":</h4> <table frame="border"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="box":</h4> <table frame="box"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="void":</h4> <table frame="void"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="above":</h4> <table frame="above"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="below":</h4> <table frame="below"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="hsides":</h4> <table frame="hsides"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="vsides":</h4> <table frame="vsides"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="lhs":</h4> <table frame="lhs"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> <h4>With frame="rhs":</h4> <table frame="rhs"> <tr><td>First</td><td>Row</td></tr> <tr><td>Second</td><td>Row</td></tr> </table> </body> </html> Hasilnya :
HTML Lists
Dukungan HTML untuk defenition lists 1. Unordered list
<html> <body> <h4>Disc bullets list:</h4> <ul type="disc"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ul> <h4>Circle bullets list:</h4> <ul type="circle"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ul> <h4>Square bullets list:</h4> <ul type="square"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ul> </body> </html>
Hasilnya :
2. Ordered list
<html> <body> <h4>Numbered list:</h4>
<ol> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ol> <h4>Letters list:</h4> <ol type="A"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ol> <h4>Lowercase letters list:</h4> <ol type="a"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li>
<li>Oranges</li> </ol>
<ol type="I"> <li>Apples</li> <li>Bananas</li> <li>Lemons</li> <li>Oranges</li> </ol>
Hasilnya :
Hasilnya :
3. Definition Lists
</html> <body> <h4> Contoh Definition Lists </h4> <dl> <dt>Coffee</dt> <dd>Black hot drink</dd> <dt>Milk</dt> <dd>White cold drink</dd> </dl> </body> </html>
Hasilnya :
Hasilnya : 9
</body> </html>
Hasilnya :
<p> Bila pemakai memilih click pada radio-button, maka button menjadi terpilih dengan tanda lingkaran hitam ditengahnya, dan button yang lain akan berubah menjadi tidak terpilih. </p> </body> </html>
Hasilnya :
Hasilnya :
10
</p>
<form> <select name="cars"> <option value="volvo">Volvo <option value="saab">Saab <option value="fiat">Fiat <option value="audi">Audi </select> </form> <p> Klick tanda segitiga pilihan dan sorot salah satu pilihan, ketika mouse dilepas maka yang terpilih tampil pada text field. </p> </body> </html>
<textarea rows="10" cols="30"> Saya sedang melakukan ujicoba penulisan pada text Area. </textarea> </body>
</html>
Hasilnya :
Hasilnya :
Membuat Button <html> <body> <form> <input type="button" value="Hello world!"> </form>
</body> </html>
Hasilnya :
Membuat Textarea
<html> <body> <p> Contoh ini dapat di edit seperti editor biasa. Silahkan
11
<input type="text" name="comment" value="yourcomment" size="40"> <br><br> <input type="submit" value="Send"> <input type="reset" value="Reset"> </form> </body> </html>
Hasilnya :
Enter your first name: <input type="text" name="FirstName" value="Mickey"> <br>Enter your last name: <input type="text" name="LastName" value="Mouse"> <br> <input type="submit" value="Submit"> </form> <p> If you click the "Submit" button, you will send your input to a new page called html_form_action.asp. </p> </body> </html>
Hasilnya :
Start Tag
NN IE
W3C Purpose Defines an ordered list Defines an unordered list Defines a list item Defines a definition list Defines a definition term Defines a definition description Deprecated. Use <ul> instead
3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2
12
<menu>
Table Tags:
NN: Netscape, IE: Internet Explorer, W3C: Web Standard
NN IE
W3C Purpose Defines a table Defines a table header Defines a table row Defines a table cell Defines a table caption Defines groups of table columns Defines the attribute values for one or more columns in a table Defines a table header that will not scroll Defines a table body that scrolls within a fixed table header and table footer Defines a table footer that will not scroll
3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 3.0 3.2 3.0 4.0
<col>
3.0 4.0
<thead>
4.0 4.0
<tbody>
4.0 4.0
<tfoot>
4.0 4.0
Tag frame
Start Tag <frameset> <frame> <noframes> <iframe> NN 3.0 3.0 3.0 6.0 IE 3. 0 3. 0 3. 0 3. 0 W3C 4.0 4.0 4.0 4.0 Purpose Defines a set of frames Defines a sub window (a frame) Defines a noframe section for browsers that do not handle frames Defines an inline sub window (frame)
target="_parent" target="_top"
13