HTML
HTML ( HyperText Markup Language) adalah sebuah bahasa standar yang digunakan browser Internet untuk membuat halaman dan dokumen pada sebuah web yang kemudian dapat diakses dan di baca layaknya sebuah artikel. HTML ini memiliki beberapa kegunaan diantaranya adalah :
Kita dapat menampilkan teks dalam bentuk cetakan tebal Kita dapat menampilkan sekelompok kata dalam bentuk miring Kita dapat menampilkan suatu kelompok kata dalam beberapa ukuran yang dapat digunakan untuk judul heading dan sebaginya
Introduction
Contoh
Penjelsan
</body> </html>
HTML Table
HTML Table
Source Code
<!DOCTYPE html> <html> <body>
Result
baris 1, sel 1 baris 1, sel 2
baris 2, sel 1
baris 2, sel 2
<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>
</body> </html>
Table Header
Header dalam table di definisikan dengan tag <th>
Source Code
<!DOCTYPE html> <html> <body>
Result
Header 1
Header 2
baris 1, sel 2 baris 2, sel 2
<table border="1"> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>
</body> </html>
HTML List
Source Code
<!DOCTYPE html>
<html> <body>
Result
Coffee
Milk
Source Code
<!DOCTYPE html>
<html> <body> <ol> <li>Coffee</li> <li>Milk</li> </ol> </body> </html>
Result
1.
2.
Coffee
Milk
Source Code
<!DOCTYPE html> <html> <body> <dl> <dt>Coffee</dt> <dd>- black hot drink</dd> <dt>Milk</dt> <dd>- white cold drink</dd> </dl> </body> </html>
Result
Kopi - Hitam minuman panas Susu - Minuman dingin putih
HTML Form
HTML Form
Bentuk HTML dapat mengandung unsur-unsur masukan seperti bidang teks, checkbox, radio button, tombol submit dan banyak lagi. Formulir juga dapat berisi daftar pilih, textarea, fieldset, legenda, dan elemen label
Text Fields
<input type="text"> mendefinisikan satu baris field input pengguna dapat memasukkan teks ke:
Source Code
<!DOCTYPE html>
<html> <body>
Result
Nama depan Nama belakang : :
<form> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"> </form> </body> </html>
Password Field
<input type="password"> mendefinisikan kolom password:
Source Code
<!DOCTYPE html>
<html> <body> <form> Password: <input type="password" name="pwd"> </form> </body> </html>
Result
Password :
Radio Buttons
Source Code
<!DOCTYPE html>
<html> <body> <form> <input type="radio" name="sex" value="male">Male<br> <input type="radio" name="sex" value="female">Female </form> </body> </html>
Result
Checkbox
<input type="checkbox"> mendefinisikan kotak centang. Checkbox membiarkan pengguna pilih ZERO atau LEBIH pilihan dari sejumlah pilihan
Source Code
<!DOCTYPE html>
<html> <body> <form> <input type="checkbox" name="vehicle" value="Bike">I have a bike<br> <input type="checkbox" name="vehicle" value="Car">I have a car </form> </body> </html>
Result
Submit Button
<input type="submit"> mendefinisikan tombol kirim
Source Code
<!DOCTYPE html>
<html> <body> <form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user"> <input type="submit" value="Submit"> </form> </body> </html>
Result
HTML Headings
Judul HTML didefinisikan dengan <h1> untuk <h6> tag
Source Code
<!DOCTYPE html> <html> <body> <h1>This is heading 1</h1>
Result
This is heading 1
This is heading 2 This is heading 3 This is heading 4
This is heading 5
This is heading 6
HTML Paragraf
Paragraf HTML di definisikan dengan <P> tag
Source Code
!DOCTYPE html> <html>
Result
<body>
<p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> </body> </html>
HTML Links
HTML Link di definisikan dengan <a> tag
Source Code
<!DOCTYPE html> <html> <body> <a href="http://www.w3schools.com"> This is a link</a> </body> </html>
Result
This is a link
HTML Image
HTML Image di definisikan dengan <img> tag
Source Code
<!DOCTYPE html> <html> <body> <img src="w3schools.jpg" width="104" height="142"></body> </html>
Result
HTML Media
HTML Object
HTML Object
HTML Helpers (Plug-ins) adalah sebuah program komputer yang memperluas Fungsionalitas standar browser. Contoh Plug-ins yang terkenal adalah Adobe Flash Player dan QuickTime Plug ins ini dapat ditambahkan ke halaman web melalui tag <object> atau tag <embed>
<body>
<object width="420" height="360" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="liar.wav"> <param name="controller" value="true"> </object> </body> </html>
<body>
<object width="400" height="40" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"> <param name="SRC" value="bookmark.swf"> <embed src="bookmark.swf" width="400" height="40"></embed> </object> </body> </html>
<object width="100%" height="100%" type="video/x-ms-asf" url="3d.wmv" data="3d.wmv" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> <param name="url" value="3d.wmv"> <param name="filename" value="3d.wmv"> <param name="autostart" value="1"> <param name="uiMode" value="full">
</body>
</html>
HTML Audio
<!DOCTYPE html>
<html>
<body> <embed height="50" width="100" src="horse.mp3">
<p>If you cannot hear the sound, your computer or browser doesn't support the sound format.</p>
<p>Or, you have your speakers turned off.</p> </body>
</html>
Source Code
<!DOCTYPE html> <html> <body> <embed height="50" width="100" src="horse.mp3"> <p>If you cannot hear the sound, your computer or browser doesn't support the sound format.</p> <p>Or, you have your speakers turned off.</p>
Problems
Browser mendukung berbagai format audio yang berbeda Jika browser tidak mendukung format file, audio tidak akan bermain tanpa plug-in
Jika plug-in tidak diinstal pada komputer pengguna, audio tidak akan bermain
Jika Anda mengkonversi file ke format lain, tetap saja tidak akan bermain di semua browser
</body> </html>
Source Code
<!DOCTYPE html> <html> <body>
Problems
<object height="50" width="100" data="horse.mp3"></object> <p>If you cannot hear the sound, your computer or browser doesn't support the sound format.</p>
</body> </html>
HTML5 tag <audio> mendefinisikan suara, seperti musik atau audio stream lainnya.
Problem
<audio controls> <source src="horse.mp3" type="audio/mpeg"> <source src="horse.ogg" type="audio/ogg"> Your browser does not support this audio format. </audio>
</body> </html>
Source Code
<!DOCTYPE html> <html> <body>
Problem
<audio controls> <source src="horse.mp3" type="audio/mpeg"> <source src="horse.ogg" type="audio/ogg"> <embed height="50" width="100" src="horse.mp3"> </audio>
Unsur <embed> tidak bisa "jatuh kembali" untuk menampilkan pesan kesalahan
</body> </html>
Yahoo Media Player - Sebuah Cara untuk Tambah Audio ke Situs Anda
Anda dapat menambahkannya ke halaman Anda (atau blog) dengan satu baris kode, dan mudah mengubah halaman HTML Anda ke daftar putar profesional:
Source Code
<!DOCTYPE html> <html> <body> <p><a href="horse.mp3">Play mp3</a></p> <p><a href="liar.wav">Play wav</a></p> <script src="http://mediaplayer.yahoo.com/latest"></script> </body> </html>
Result
Play mp3
Play wav
HTML Video
<embed> Element
Tujuan dari tag <embed> adalah elemen multimedia menanamkan dalam halaman HTML. Berikut fragmen HTML menampilkan video Flash yang tertanam di halaman web:
Source Code
<!DOCTYPE html> <html> <body> <h2>Playing the Object</h2>
Problem
<embed src="intro.swf" width="200" height="200"><p>If you cannot see this, your computer doesn't support the format</p> </body> </html>
Source Code
<!DOCTYPE html> <html> <body> <object height="200" width="200" data="intro.swf"></object> </body> </html>
Problem
Source Code
<!DOCTYPE html> <html> <body>
Problem
</body> </html>
Contoh di bawah ini menggunakan 4 format video yang berbeda. HTML 5 elemen <video> mencoba untuk memutar video baik dalam MP4, OGG, atau format WebM. Jika gagal, kode "jatuh kembali" untuk mencoba elemen <object>. Jika ini juga gagal, itu "jatuh kembali" ke elemen <embed>:
Source Code
<!DOCTYPE html> <html> <body>
Problem
<video width="320" height="240" controls autoplay> <source src="movie.ogg" type="video/ogg"> <source src="movie.mp4" type="video/mp4"> <source src="movie.webm" type="video/webm"> <object data="movie.mp4" width="320" height="240"> <embed width="320" height="240" src="movie.swf"> </object> </video>
</body> </html>
Video Youtube
Example Youtube iFrame
<!DOCTYPE html>
<html> <body> <iframe width="420" height="345"
src="http://www.youtube.com/embed/XGSy3_Czz8k">
</iframe> </body>
</html>
http://www.w3schools.com
Wassalamualaikum