WeasyPrint: Background image does not cover page margin area
When using background-image with background-size: cover; on a @page, the page margin area is not covered. However, when using background-color, the page margin area is covered. The problem might be similar to https://github.com/Kozea/WeasyPrint/issues/1943
<html>
<head>
<style>
@page {
size: A4;
margin: 3cm;
background-image: url("https://upload.wikimedia.org/wikipedia/commons/6/6a/PNG_Test.png");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<h1>CONTENT</h1>
</body>
</html>
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 16 (13 by maintainers)
Commits related to this issue
- Set page background origin to margin box when attachment is fixed Fix #1993. — committed to kygoh/WeasyPrint by liZe 8 months ago
With
background-attachment: fixedthe background images are positioned as expected and cover the whole page including the margin area. Thanks for implementing it 😄