Stil dullar Özellik
Örnek
Dulları değiştirin ve baskı veya baskı önizlemesini kontrol edin:
<html>
<head>
<script>
function ChangeWidows()
{
document.getElementById("p1").style.widows = document.getElementById("widows").value;
}
</script>
<style>
.othercontent
{
width: 400px;
border-top: 19cm solid #c3c3c3;
}
@page
{
/* set size of printed page */
size: 21cm 27cm;
margin-top: 2cm;
}
@media print
{
.widows
{
widows:2;
}
}
</style>
</head>
<body>
<div class="othercontent">
<input id="widows" value="2">
<button onclick="ChangeWidows();">Change widows</button>
<p style="font-size:120%" id="p1">
Change widows and see the print preview.<br>
Line 2<br>
Line 3<br>
Line 4<br>
Line 5<br>
Line 6<br>
Line 7<br>
Line 8<br>
</p>
<div class="othercontent">
</body>
</html>
Kendin dene "
Tanım ve Kullanım
widows özelliği, bir sayfanın üst kısmında görünmesi gereken bir öğe için minimum satır sayısını ayarlar veya döndürür (baskı veya baskı önizleme için).
Widows özelliği yalnızca blok düzeyindeki öğeleri etkiler.
İpucu: widows:5, sayfa sonunun altında en az 5 satırın görünmesi gerektiği anlamına gelir.
İpucu: Sayfanın altında görünmesi gereken bir öğe için minimum satır sayısını ayarlamak veya döndürmek için orphans özelliğine bakın.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
widows | Yes | Not supported | Not supported | Not supported | Yes |
Sözdizimi
Widows özelliğini döndürün:
object.style.widows
Widows özelliğini ayarlayın:
object.style.widows = "number|initial|inherit"
Mülk değerleri
Value | Description |
---|---|
number | An integer that specifies the minimum number of visible lines. Negative values are not allowed. The default value is 2 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Teknik detaylar
Varsayılan değer: | 2 |
---|---|
Geri dönüş değeri: | Sayfanın üst kısmında yazdırılacak minimum satır sayısını temsil eden bir Dize |
CSS Sürümü | CSS2 |
❮ Stil Nesnesi