11

I have a logo inside the Logo tags. For printing style i made a @print media query css. If i print it out the logo will printed on every page - but it should only shown on the first page.

Tried with that:

header { display:none; }
@page:first { 
  header { display:block; } 
}

but so the header will deleted on every pages! Any tipps? Thanks

Stiller Eugen
  • 651
  • 1
  • 10
  • 27

1 Answers1

0

You can provide a condition to CSS telling it to not apply the header on any page except the first.

header { display:block; }
@page :not(:first) {
   header { display:none; }
}

The predicate :not(:first) prevents the header being displayed on subsequent pages.

Bob Dalgleish
  • 8,057
  • 4
  • 31
  • 41
  • 1
    Doesn't work, sadly. I assume it's because you can only set basic css properties with :first: https://developer.mozilla.org/en-US/docs/Web/CSS/:first – Jonas Feb 12 '22 at 14:07