@page
@page
CSS @규칙은 문서를 인쇄할 때 일부 CSS 속성을 수정하는 데 쓰입니다. @page
로 모든 CSS 속성을 바꿀 수는 없습니다. 문서의 margin, orphan, widow(앞단에서 넘어온 짤막한 행) 및 page break만 바꿀 수 있습니다. 다른 CSS 속성을 바꾸려는 시도는 무시됩니다.
@page {
margin: 1cm;
}
@page :first {
margin: 2cm;
}
@page
@규칙은 CSS 객체 모델 인터페이스 CSSPageRule
를 통해 액세스될 수 있습니다.
구문
서술자
size
- 페이지 박스 내 포함 블록의 대상(target) 크기 및 방향을 지정합니다. 한 페이지 박스가 한 페이지 시트에 렌더링 되는 일반적인 경우에, 또한 대상(destination) 페이지 시트의 크기를 나타냅니다.
marks
- 문서에 crop 및/또는 registration 마크를 추가합니다.
bleed
- 페이지 렌더링이 잘리는(clip) 페이지 박스 너머 범위를 지정합니다.
형식 구문
@page <page-selector-list> { <page-body> }where
<page-selector-list> = [ <page-selector># ]?
<page-body> = <declaration>? [ ; <page-body> ]? | <page-margin-box> <page-body>where
<page-selector> = <pseudo-page>+ | <ident> <pseudo-page>*
<page-margin-box> = <page-margin-box-type> '{' <declaration-list> '}'where
<pseudo-page> = : [ left | right | first | blank ]
<page-margin-box-type> = @top-left-corner | @top-left | @top-center | @top-right | @top-right-corner | @bottom-left-corner | @bottom-left | @bottom-center | @bottom-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom
예제
명세
명세 | 상태 | 설명 |
---|---|---|
CSS Logical Properties and Values Level 1 The definition of ':recto and :verso' in that specification. |
Editor's Draft | :recto 및 :verso 페이지 선택자 추가 |
CSS Paged Media Module Level 3 The definition of '@page' in that specification. |
Working Draft | CSS Level 2 (Revision 1)에서 변화 없음, 더 많은 CSS at-규칙이 @page 내에 사용될 수 있지만. |
CSS Level 2 (Revision 1) The definition of '@page' in that specification. |
Recommendation | 초기 정의 |
브라우저 호환성
BCD tables only load in the browser