Skip to content

Instantly share code, notes, and snippets.

@shiffman
Created November 26, 2012 03:09
Show Gist options
  • Save shiffman/4146422 to your computer and use it in GitHub Desktop.
Save shiffman/4146422 to your computer and use it in GitHub Desktop.
HTML for different page numbering for front matter vs content
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>The Nature of Code</title>
<style type="text/css">
div#frontmatter {
page: frontmatter;
}
@page :left {
@bottom-left {
content: counter(page);
}
}
@page :right {
@bottom-right {
content: counter(page);
}
}
@page frontmatter :left {
@bottom-left {
content: counter(page,lower-roman);
}
}
@page frontmatter :right {
@bottom-right {
content: counter(page,lower-roman);
}
}
</style>
</head>
<body>
<div id ="frontmatter">
<h1>Front Matter</h1>
<p>
This is page 1.
</p>
</div>
<div style="page-break-after:always;"> </div>
<h1>Content</h1>
<p>
This is page 2.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment