स्टाइल विधवाओं की संपत्ति
उदाहरण
विधवाओं को बदलें और प्रिंट या प्रिंट पूर्वावलोकन देखें:
<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>
इसे स्वयं आज़माएं "
परिभाषा और उपयोग
विधवा संपत्ति एक तत्व के लिए न्यूनतम संख्या में पंक्तियों को सेट या लौटाती है जो पृष्ठ के शीर्ष पर दिखाई देनी चाहिए (मुद्रण या प्रिंट पूर्वावलोकन के लिए)।
विधवाओं की संपत्ति केवल ब्लॉक स्तर के तत्वों को प्रभावित करती है।
युक्ति: विधवाएँ: 5 का अर्थ है कि पृष्ठ विराम के नीचे कम से कम 5 पंक्तियाँ दिखाई देनी चाहिए।
युक्ति: पृष्ठ के निचले भाग में दिखाई देने वाले तत्व के लिए न्यूनतम संख्या में पंक्तियों को सेट करने या वापस करने के लिए अनाथ गुण देखें।
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
widows | Yes | Not supported | Not supported | Not supported | Yes |
वाक्य - विन्यास
विधवाओं की संपत्ति लौटाएं:
object.style.widows
विधवाओं की संपत्ति निर्धारित करें:
object.style.widows = "number|initial|inherit"
सम्पत्ति की कीमत
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 |
टेक्निकल डिटेल
डिफ़ॉल्ट मान: | 2 |
---|---|
प्रतिलाभ की मात्रा: | एक स्ट्रिंग, जो पृष्ठ के शीर्ष पर मुद्रित करने के लिए न्यूनतम पंक्तियों का प्रतिनिधित्व करती है |
सीएसएस संस्करण | सीएसएस 2 |
❮ स्टाइल ऑब्जेक्ट