Skip to content

Instantly share code, notes, and snippets.

@faceless2
Last active February 27, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faceless2/56fbb0227d9de50f72af8f42bb35b1e0 to your computer and use it in GitHub Desktop.
Save faceless2/56fbb0227d9de50f72af8f42bb35b1e0 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
:root {
counter-reset: page 0 b 0 e 0;
}
@page {
counter-increment: page 1 b 1;
margin: 36px;
@top-center {
content: counter(page);
}
}
div {
break-before: page;
counter-increment: e 1;
}
#div1 {
string-set: c counter(page), d counter(b), f counter(e);
}
</style>
</head>
<body>
<div id="div1">div1</div>
<div id="div2">Div2</div>
<div id="div3">Div3</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment