Konference Devel
1. dubna 2017
@page { size: a5 landscape; }
/* Rozdílné nastavení pro první, sudou/lichou stránku */
@page :first { … }
@page :left { … }
@page :right { … }
@page {
size: a4;
@top-left {
content: "Ze života hmyzu";
}
@bottom-right {
content: counter(page);
}
}
<section class="kapitola">
<h3>Nadpis</h3>
…
section.kapitola h3 {
string-set: kapitola contents();
}
…
@top-left {
content: string(kapitola);
}
<section class="kapitola">
<h3>Nadpis</h3>
…
section.kapitola h3 {
counter-increment: kapitola;
}
section.kapitola h3::before {
content: "Kapitola " counter(kapitola);
}
page-break-before, page-break-after a page-break-insideauto, always, avoid, left a right/* Stránka se nesmí zalomit za nadpisem */
h2 + p { page-break-before: avoid }
<h3 id="last">Závěr<h3>
…
<a href="#last" class="pageref">Poslední kapitola na straně</a>
ukončuje text.
…
a.pageref::after {
content: " " target-counter(attr(href url), page);
}
<html lang="cs">
…
html {
hyphens: auto;
}
h1 { bookmark-level: 1; }
h2 { bookmark-level: 2; }
h3 { bookmark-level: 3; }
<p>Text obsahujcící<span class="poznamka">Poznámku
pod čarou.</span> něco.</p>
…
.poznamka { float: footnote; }
<ul class="toc">
<li><a href="#uvod">Úvod</a></li>
<li><a href="#stat">Stať</a></li>
<li><a href="#zaver">Závěr</a></li>
…
/* Přidání teček a čísla strany do obsahu */
.toc a::after {
content: leader(dotted) " " target-counter(attr(href, url), page);
}