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>

image

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

With background-attachment: fixed the background images are positioned as expected and cover the whole page including the margin area. Thanks for implementing it 😄