Berfungsi untuk mengatur jarak antar baris teks. Nilai yang digunakan berupa angka (ekuivalen dengan satuan em), dalam satuan px, pt, em, cm, etc (length) dan % (persen). Nilai line-height dalam persen ditentukan berdasarkan ukuran font. Dalam property line-height tidak berlaku nilai negatif. Jika ingin membuat setiap baris lebih rapat atau hingga baris teks bertumpuk gunakan nilai yang semakin kecil.
Deklarasi line-height property
line-height: value; line-height: number; line-height: 1.5; line-height: length; line-height: 1.5em; line-height: 24px; line-height: percentage; line-height: 150%;
Contoh penggunaan:
<style type="text/css>
h3.jomblo{
font-size:1.5em;
line-height:200%;
}
pre{
font:normal 12px Courier;
line-height:18px;
}
</style>
<h3 class="jomblo">
Text here!
Text here!
Text here!
</h3>
<pre>
Text here!
Text here!
Text here!
</pre>Edit kode dalam box demo online di bawah ini untuk mengetahui dengan lebih jelas efek penggunaan line-height property dengan berbagai bentuk nilai yang bisa digunakan.
Please click the button to display. Continue with editing code and click to see the results!
Post : CSS line-height Propertyby : gubhugreyot - gubhugcss
my Blogs : Demo Tutorial Blogger-1 | Demo Tutorial Blogger-2 | Best Blogger Hacks | Best Blogger Menus | gubhuggreyot-b'detik | gubhugreyot

Tidak ada komentar:
Posting Komentar