aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/page-break-inside/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/page-break-inside/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-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.html132
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">&lt;div class="page"&gt;
+  &lt;p&gt;This is the first paragraph.&lt;/p&gt;
+  &lt;section class="list"&gt;
+    &lt;span&gt;A list&lt;/span&gt;
+    &lt;ol&gt;
+      &lt;li&gt;one&lt;/li&gt;
+&lt;!--       &lt;li&gt;two&lt;/li&gt; --&gt;
+    &lt;/ol&gt;
+  &lt;/section&gt;
+  &lt;ul&gt;
+    &lt;li&gt;one&lt;/li&gt;
+&lt;!--     &lt;li&gt;two&lt;/li&gt; --&gt;
+  &lt;/ul&gt;
+  &lt;p&gt;This is the second paragraph.&lt;/p&gt;
+  &lt;p&gt;This is the third paragraph, it contains more text.&lt;/p&gt;
+  &lt;p&gt;This is the fourth paragraph. It has a little bit more text than the third one.&lt;/p&gt;
+&lt;/div&gt;</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>