Baik Style Sheet yang dilink maupun yang disisipkan memiliki satu atau lebih definisi style. (Sintax inline kadang berbeda). Suatu definisi style terdiri dari suatu tag HTML (tag apapun), diikuti oleh sejumlah properti untuk tag tersebut yang terletak diantara tanda kurung kurawal. Tiap properti diidentifikasi oleh nama properti, diikuti oleh titik dua dan nilai properti. Properti ganda dipisahkan oleh titik koma. Sebagi contoh, definisi style berikut memberi tag <H1> ukuran font yang spesifik (15 point), dan ketebalan huruf (boldface):
H1 {font-size: 15pt;
font-weight: bold}
Anda kemudian dapat membuat definisi style untuk sejumlah tag HTML dan menempatkan nya pada file terpisah atau sisipkan langsung pada halaman web.
Referensi Style
| Atribut | Deskripsi | Nilai | Contoh |
| Sets size of text. | points (pt) | {font-size: 12pt} | |
| Sets typeface. | typeface name | {font-family: courier} | |
| Sets thickness of type. | extra-light | {font-weight: bold} | |
| Italicizes text. | normal | {font-style: italic} | |
| Sets the distance between baselines. | points (pt) | {line-height: 24pt} | |
| Sets color of text. | color-name | {color: blue} | |
| Underlines or otherwise highlights text. | none | {text-decoration: underline} | |
| Sets distance from left edge of page. | points (pt) | {margin-left: 1in} | |
| Sets distance from right edge of page. | points (pt) | {margin-right: 1in} | |
| Sets distance from top edge of page. | points (pt) | {margin-top: -20px} | |
| Sets justification. | left | {text-align: right} | |
| Sets distance from left margin. | points (pt) | {text-indent: 0.5in} | |
| Sets background images or colors. | URL, | {background: #33CC00} |
Artikel Terkait

0 comments:
Post a Comment