- HTML Background dengan color/warna.
- HTML Background dengan image/gambar.
HTML Background dengan warna
Misalkan kita memiliki kita ingin memberikan background warna pada elemen tabel :
<table>
<tr>
<td width="100" height="100">
</td>
</tr>
</table>
<table bgcolor="red">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>HTML Editori<table bgcolor="red">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>Dengan CSS :
Kita tambahkan style="background-color:red" pada tag pembuka table.<table style="background-color:red">
<tr>
<td width="100" height="100">
</td>
</tr>
</table><table style="background-color:red">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>HTML Background Image
Kita tetap akan menggunakan kode seperti di atas.Tanpa CSS
Kita tambahkah dalam tag <table> dengan background:"http://codingku.com/html/img/pattern.gif"<table background="http://codingku.com/html/img/pattern.gif">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>HTML Editori
<table background="http://codingku.com/html/img/pattern.gif">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>Dengan CSS
<table style="background-image:url('http://codingku.com/html/img/pattern.gif')">
<tr>
<td width="100" height="100">
</td>
</tr>
</table>
Monday 8 April 2013
HTML Background
HTML Background dibagi menjadi dua :