Skip to content

background-image to @page #2422

@itajackass

Description

@itajackass

I'd like to set a background-image to entire A4 document using background-size: cover CSS prop.
I tried to apply it to @page but css doesn't work.
It work if I apply it to, for example, BODY element. But the problem is that the document need a margin (for example I apply @page { margin: 2cm; } ) but applying margin to @page, the my background-image applied to BODY doesn't cover entire A4 doc.

I tried to apply @page { margin:0;} body {background-size:cover; background-image: url('...')} but in this case, my content text has no margin. If I apply margin to BODY element, then my text doesn't go to next page and overflow inside footer space....

any suggest?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions