Why is @page :first {...} working strange?

51 Views Asked by At

I have several Dita Topics that are combined into one map. The map should get a cover image. I have inserted this using css (as shown in the code). Unfortunately, this is not only displayed on the first page, but on every chapter page of a created PDF. I work with Oxygen and Prince.

@page{
    size:A4;
}

@page :first{
    background-image: url("Bilder/titelbild.png");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: right;
}
1

There are 1 best solutions below

0
On

Are you using -prince-page-group in your CSS? (See https://www.princexml.com/doc/paged/#page-groups)

It seems that @page :first applies to the first page of every page group.

You might want to use a separate named page for the cover page.