CKTIS / CSS
@bottom-right-corner — pole marginesu strony
@bottom-right-corner definiuje pole marginesu strony w położeniu prawy dolny / narożny; pudełko powstaje wewnątrz @page, a nie przez dopasowanie elementu.
Wersja: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Składnia
@bottom-right-corner { <declaration-list> }@bottom-right-corner { <declaration-list> }. Pudełko zajmuje położenie prawy dolny / narożny na obwodzie strony. Reguła działa wyłącznie wewnątrz @page i generuje pudełko tylko wtedy, gdy content nie ma wartości normal ani none.
Używa się go do nagłówków, stopek, tytułów sekcji albo liczników stron, nie do wybierania elementów DOM. Pudełka krawędzi dzielą długość boku z sąsiadami, a pudełko narożne ma wymiary wyznaczone przez przecinające się marginesy.
Przykład zagnieżdża regułę w @page, ustawia tekst i kolor, a następnie odczytuje prawdziwy CSSMarginRule i deskryptor content.
Przykłady
const style = document.createElement('style');
style.textContent = "@page { margin: 20mm; @bottom-right-corner { content: \"bottom-right-corner\"; color: rgb(0, 128, 0); } }";
document.head.append(style);
const pageRule = style.sheet.cssRules[0];
const marginRule = pageRule.cssRules?.[0];
console.log('page=' + pageRule.constructor.name + '; box=' + (marginRule?.constructor.name || 'unsupported') + '; content=' + (marginRule?.style?.content || 'unavailable'));Wynik
page=CSSPageRule; box=CSSMarginRule; content="bottom-right-corner"
@bottom-right-corner definiuje pole marginesu strony w położeniu prawy dolny / narożny; pudełko powstaje wewnątrz @page, a nie przez dopasowanie elementu.