i have a simple css:
i insert `pagebreak` class in html where the previous page i want to be blank.
my simple html looks like:
it works fine when i put it above `h1#chapter-1` but when i put the class `pagebreak` on `h2#writing-a-table-of-contents` or `h1#chapter-2` then it still works as if it's put on `h1#chapter-1` ,i.e, i get an empty page between`h1#chapter-1` & `#toc`
is there a way to write a generic `.pagebreak` class that works always.
i've also tried changing the `.pagebreak::before` to `.pagebreak::after` & it doesn't work for some reason. checked out other forums messages on the same topic but too confusing to understand.
.pagebreak::before {
content: ' ';
display: block;
page-break-after: always;
}
i insert `pagebreak` class in html where the previous page i want to be blank.
my simple html looks like:
<div class="container">
<div class="frontcover"></div>
<nav id="toc" role="doc-toc" class="pagebreak">
<h1>table of contents</h1>
<ol>
<li class="chapter"><a href="#chapter-1">chapter 1</a></li>
<li class="ml-3">
<a href="#writing-a-table-of-contents"
>writing a table of contents</a
>
</li>
<li class="chapter"><a href="#chapter-2">chapter 2</a></li>
</ol>
</nav>
<h1 class="chapter" id="#chapter-1">chapter 1</h1>
<h2 class="subtitle" id="#writing-a-table-of-contents">
writing a table of contents
</h2>
<h1 class="chapter" id="#chapter-2">chapter 2</h1>
</div>
it works fine when i put it above `h1#chapter-1` but when i put the class `pagebreak` on `h2#writing-a-table-of-contents` or `h1#chapter-2` then it still works as if it's put on `h1#chapter-1` ,i.e, i get an empty page between`h1#chapter-1` & `#toc`
is there a way to write a generic `.pagebreak` class that works always.
i've also tried changing the `.pagebreak::before` to `.pagebreak::after` & it doesn't work for some reason. checked out other forums messages on the same topic but too confusing to understand.