--- title: CSS分页规则 slug: Web/API/CSS分页规则 translation_of: Web/API/CSSPageRule --- <div>{{APIRef("CSSOM")}}</div> <p><strong><code>CSSPageRule</code></strong> 是代表一个css接口 {{cssxref("@page")}} 规则. 它实现了 {{domxref("CSSRule")}} 类型值为6的接口 (<code>CSSRule.PAGE_RULE</code>).</p> <h2 id="语法">语法</h2> <p>这个语法是使用 <a href="https://dev.w3.org/2006/webapi/WebIDL/">WebIDL</a> 格式.</p> <pre class="syntaxbox">interface CSSPageRule : CSSRule { attribute DOMString selectorText; readonly attribute CSSStyleDeclaration style; }; </pre> <h2 id="Properties">Properties</h2> <p> {{domxref("CSSRule")}}, <code>CSSPageRule</code> 也实现了此接口的属性。 它具有以下特定属性:</p> <dl> <dt>{{domxref("CSSPageRule.selectorText")}}</dt> <dd>表示与规则关联的页面选择器的文本。</dd> <dt>{{domxref("CSSPageRule.style")}} {{readonlyinline}}</dt> <dd>返回与规则关联的声明块。</dd> </dl> <h2 id="Methods">Methods</h2> <p>作为 {{domxref("CSSRule")}}, <code>CSSPageRule</code> 的CSSPageRule还实现了该接口的方法。 它没有具体方法。</p> <h2 id="Specifications">Specifications</h2> <table class="standard-table"> <thead> <tr> <th scope="col">规格</th> <th scope="col">状态</th> <th scope="col">注释</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSSOM', '#the-csspagerule-interface', 'CSSPageRule')}}</td> <td>{{Spec2('CSSOM')}}</td> <td> <p>没有变化 {{SpecName('DOM2 Style')}}</p> </td> </tr> <tr> <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSPageRule', 'CSSPageRule')}}</td> <td>{{Spec2('DOM2 Style')}}</td> <td>初始定义</td> </tr> </tbody> </table> <h2 id="Browser_compatibility">Browser compatibility</h2> <p>{{Compat("api.CSSPageRule")}}</p>