सीएसएस ब्रेक- प्रॉपर्टी से पहले
उदाहरण
हमेशा <h1> तत्व से पहले पेज-ब्रेक डालें:
@media print
{
h1 {
break-before: always;
}
}
परिभाषा और उपयोग
break-before
गुण निर्दिष्ट करता है कि निर्दिष्ट तत्व से पहले पृष्ठ विराम, स्तंभ विराम या क्षेत्र विराम होना चाहिए या नहीं ।
break-before
संपत्ति CSS2 संपत्ति का विस्तार करती है ।
page-break-before
का उपयोग करके break-before
, आप ब्राउज़र को उस तत्व को लागू करने से पहले पृष्ठ, कॉलम या क्षेत्र को तोड़ने के लिए कह सकते हैं break-before
, या तत्व को विभाजित करने और दो पृष्ठों में फैलाने से बच सकते हैं।
डिफ़ॉल्ट मान: | ऑटो |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | CSS3 |
जावास्क्रिप्ट सिंटैक्स: | वस्तु .style.breakBefore="हमेशा" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
break-before | 50.0 | 10.0 | 65.0 | 10.0 | 37.0 |
सीएसएस सिंटेक्स
break-before: auto|all|always|avoid|avoid-column|avoid-page|avoid-region|column|left|page|recto|region|right|verso|initial|inherit;
सम्पत्ति की कीमत
Value | Description |
---|---|
auto | Default. Automatic page/column/region break before the element |
all | Always insert a page-break right before the principal box |
always | Always insert a page-break before the element |
avoid | Avoid a page/column/region break before the element |
avoid-column | Avoid a column-break before the element |
avoid-page | Avoid a page-break before the element |
avoid-region | Avoid a region-break before the element |
column | Always insert a column-break before the element |
left | Insert one or two page-breaks before the element so that the next page is formatted as a left page |
page | Always insert a page-break before the element |
recto | Insert one or two page-breaks before the principal box so that the next page is formatted as a recto page |
region | Always insert a region-break before the element |
right | Insert one or two page-breaks before the element so that the next page is formatted as a right page |
verso | Insert one or two page-breaks before the principal box so that the next page is formatted as a verso page |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
यह सुनिश्चित करने के लिए कि सभी नए अध्याय एक सही पृष्ठ पर शुरू होने चाहिए (जैसे किसी पुस्तक में) मुद्रित होने पर, आप सभी <h1> तत्वों के लिए ब्रेक-बिफोर: राइट का उपयोग कर सकते हैं:
@media print
{
h1 {
break-before: right;
}
}
उदाहरण
किसी क्षेत्र में <ul> तत्वों से पहले हमेशा एक क्षेत्र-विराम डालें:
.region ul {
break-before: region;
}
}