:first
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2023ë 8ì.
Want more browser support for this feature? Tell us why.
CSS :first ìì¬ í´ëì¤ë @page @-ê·ì¹ê³¼ í¨ê» ì¬ì©ëë©°, ì¶ë ¥ ìì 첫 íì´ì§ë¥¼ ëíë
ëë¤.
/* Selects the first page when printing */
@page :first {
margin-left: 50%;
margin-top: 50%;
}
ì°¸ê³ :
first ìì¬ í´ëì¤ ìììë CSS ìì±ì ì¬ì©ì´ ì íë©ëë¤. ë°ê¹¥ ì¬ë°±, orphans, widowsì íì´ì§ ëê¹ë§ ë°ê¿ ì ìì¼ë©°, ì¬ë°± ì§ì ì ì ëê¸¸ì´ ë¨ìë§ ì¬ì©í ì ììµëë¤. ë¤ë¥¸ 모ë ìì±ì 무ìí©ëë¤.
구문
Error: could not find syntax for this itemìì
>HTML
<p>First Page.</p>
<p>Second Page.</p>
<button>ì¶ë ¥!</button>
CSS
@page :first {
margin-left: 50%;
margin-top: 50%;
}
p {
page-break-after: always;
}
JavaScript
document.querySelector("button").addEventListener("click", () => {
window.print();
});
ê²°ê³¼
"ì¶ë ¥!" ë²í¼ì ëë¬ íì´ì§ ì¶ë ¥ íë©´ì íì¸í´ë³´ì¸ì. 첫 ë²ì§¸ íì´ì§ì ì½í ì¸ ë ì¤ì ì´ëê°ì ìì¹íê³ , ë ë²ì§¸ íì´ì§ì ì½í ì¸ ë 기본 ìì¹ì ì¡´ì¬í´ì¼ í©ëë¤.
ëª ì¸
| Specification |
|---|
| CSS Paged Media Module Level 3 > # first-pseudo > |