CSS satır yüksekliği Özellik
Örnek
Farklı <div> öğeleri için satır yüksekliğini ayarlayın:
div.a {
line-height: normal;
}
div.b {
line-height: 1.6;
}
div.c {
line-height:
80%;
}
div.d {
line-height: 200%;
}
Aşağıda daha fazla "Kendiniz Deneyin" örnekleri.
Tanım ve Kullanım
Özellik line-height
, bir satırın yüksekliğini belirtir.
Not: Negatif değerlere izin verilmez.
Varsayılan değer: | normal |
---|---|
Miras: | Evet |
canlandırılabilir: | Evet. Canlandırılabilir hakkında bilgi edinin |
Sürüm: | CSS1 |
JavaScript sözdizimi: | nesne .style.lineHeight="30px" |
Tarayıcı Desteği
Tablodaki sayılar, özelliği tam olarak destekleyen ilk tarayıcı sürümünü belirtir.
Property | |||||
---|---|---|---|---|---|
line-height | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
CSS Sözdizimi
line-height: normal|number|length|initial|inherit;
Mülk değerleri
Value | Description | Play it |
---|---|---|
normal | A normal line height. This is default | |
number | A number that will be multiplied with the current font-size to set the line height | |
length | A fixed line height in px, pt, cm, etc. | |
% | A line height in percent of the current font size | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Daha fazla örnek
Örnek
Farklı <div> öğeleri için satır yüksekliğini piksel ve santimetre olarak ayarlayın:
div.a {
line-height: 10px;
}
div.b {
line-height: 30px;
}
div.c {
line-height:
0.5cm;
}
div.d {
line-height: 1cm;
}
Örnek
Farklı <div> öğeleri için satır yüksekliğini bir sayı olarak ayarlayın:
div.a {
line-height: 0.5;
}
div.b {
line-height: 1.6;
}
div.c {
line-height: 2;
}
İlgili Sayfalar
CSS eğitimi: CSS Metni
HTML DOM referansı: lineHeight özelliği