From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/uk/web/css/@page/index.html | 112 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 files/uk/web/css/@page/index.html (limited to 'files/uk/web/css/@page/index.html') diff --git a/files/uk/web/css/@page/index.html b/files/uk/web/css/@page/index.html new file mode 100644 index 0000000000..7704892bfb --- /dev/null +++ b/files/uk/web/css/@page/index.html @@ -0,0 +1,112 @@ +--- +title: '@page' +slug: Web/CSS/@page +tags: + - '@page' + - At-rule + - CSS + - Layout + - NeedsTranslation + - Reference + - TopicStub + - Web +translation_of: Web/CSS/@page +--- +
{{CSSRef}}
+ +

The @page CSS at-rule is used to modify some CSS properties when printing a document.

+ +

Syntax

+ +
@page {
+  margin: 1cm;
+}
+
+@page :first {
+  margin: 2cm;
+}
+ +

Descriptors

+ +
+
size
+
Specifies the target size and orientation of the page box’s containing block. In the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet.
+
+ +
+
marks
+
Adds crop and/or registration marks to the document.
+
+ +
+
bleed
+
Specifies the extent beyond the page box at which the page rendering is clipped.
+
+ +

Description

+ +

You can't change all CSS properties with @page. You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.

+ +

The @page at-rule can be accessed via the CSS object model interface {{domxref("CSSPageRule")}}.

+ +
Note: The W3C is discussing how to handle viewport-related {{cssxref("<length>")}} units, vh, vw, vmin, and vmax. Meanwhile do not use them within a @page at-rule.
+ +

Formal syntax

+ +
{{csssyntax}}
+ +

Examples

+ +

@page pseudo-class examples

+ +

Please refer to the various pseudo-classes of @page for examples.

+ + + +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS Logical Properties', '#page', ':recto and :verso')}}{{Spec2('CSS Logical Properties')}}Adds the :recto and :verso page selectors
{{SpecName('CSS3 Paged Media', '#at-page-rule', '@page')}}{{Spec2('CSS3 Paged Media')}}No change from {{SpecName('CSS2.1')}}, though more CSS at-rules can be used inside a @page.
{{SpecName('CSS2.1', 'page.html#page-selectors', '@page')}}{{Spec2('CSS2.1')}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("css.at-rules.page")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf