You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello world</title>
<style>
h1 {
string-set: runningheader content(text);
page-break-after: right;
}
h2, h3, h4, h5, h6 {
page-break-inside: avoid;
page-break-after: avoid;
}
p {
widows: 3;
orphans: 3;
}
a {
string-set: lastlink attr(href);
}
@page {
/* width and height. In this case for an A5 */
size: 148.5mm 210mm;
/* Bigger bleed as weasyprint draws the cropmarks within the bleed*/
@top-center {
content: "Hello world example file";
}
@bottom-center {
content: counter(page);
}
@top-left {
color: red;
font-size: 80%;
content: string(runningheader);
}
@top-right {
content: string(lastlink);
}
}
@page:left {
/* Only applied on left pages */
margin-left: 40mm;
}
@page:right {
/* Only applied on right pages */
margin-right: 40mm;
}
</style>
</head>
<body>
<h1>
Hello world.
</h1>
<p>This document started as a <a href="http://osp.kitchen">website</a>.</p>
<p>This is a second paragraph.</p>
</body>
</html>