diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/page-break-inside/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/page-break-inside/index.html')
-rw-r--r-- | files/zh-cn/web/css/page-break-inside/index.html | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/page-break-inside/index.html b/files/zh-cn/web/css/page-break-inside/index.html new file mode 100644 index 0000000000..08dbf235bb --- /dev/null +++ b/files/zh-cn/web/css/page-break-inside/index.html @@ -0,0 +1,132 @@ +--- +title: page-break-inside +slug: Web/CSS/page-break-inside +tags: + - page-break-inside +translation_of: Web/CSS/page-break-inside +--- +<div>{{CSSRef}}</div> + +<p><strong><code>page-break-inside</code></strong> CSS 属性调整当前元素内的分页符。</p> + +<pre class="brush:css no-line-numbers">/* Keyword values */ +page-break-inside: auto; +page-break-inside: avoid; + +/* Global values */ +page-break-inside: inherit; +page-break-inside: initial; +page-break-inside: unset; +</pre> + +<p>{{cssinfo}}</p> + +<h2 id="Syntax">Syntax</h2> + +<h3 id="Values">Values</h3> + +<dl> + <dt><code>auto</code></dt> + <dd>Initial value. Automatic page breaks (neither forced nor forbidden).</dd> + <dt><code>avoid</code></dt> + <dd>Avoid page breaks inside the element.</dd> +</dl> + +<h3 id="Formal_syntax">Formal syntax</h3> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="Example">Example</h2> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><div class="page"> + <p>This is the first paragraph.</p> + <section class="list"> + <span>A list</span> + <ol> + <li>one</li> +<!-- <li>two</li> --> + </ol> + </section> + <ul> + <li>one</li> +<!-- <li>two</li> --> + </ul> + <p>This is the second paragraph.</p> + <p>This is the third paragraph, it contains more text.</p> + <p>This is the fourth paragraph. It has a little bit more text than the third one.</p> +</div></pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">.page { + background-color: #8cffa0; + height: 90px; + width: 200px; + columns: 1; + column-width: 100px; +} + +.list, ol, ul, p { + break-inside: avoid; +} + +p { + background-color: #8ca0ff; +} + +ol, ul, .list { + margin: 0.5em 0; + display: block; + background-color: orange; +} + +p:first-child { + margin-top: 0; +}</pre> + +<h3 id="Result">Result</h3> + +<p>{{EmbedLiveSample("Example", 400, 160)}}</p> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS3 Paged Media', '#page-break-inside', 'page-break-inside')}}</td> + <td>{{Spec2('CSS3 Paged Media')}}</td> + <td>Allows this property on more elements.</td> + </tr> + <tr> + <td>{{SpecName('CSS2.1', 'page.html#propdef-page-break-inside', 'page-break-inside')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2> + +<p> </p> + + + +<p>{{Compat("css.properties.page-break-inside")}}</p> + +<p> </p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/CSS/page-break-after" title="CSS/page-break-after"><code>page-break-after</code></a>, <a href="/en-US/docs/CSS/page-break-before" title="CSS/page-break-before"><code>page-break-before</code></a></li> + <li><a href="/en-US/docs/CSS/orphans" title="CSS/orphans"><code>orphans</code></a>, <a href="/en-US/docs/CSS/widows" title="CSS/widows"><code>widows</code></a></li> +</ul> |