Forum How do I...?

Header on all pages except first

cscalfani
I cannot seem to get the following to work:
@page :not(:first)


Also tried
@page :first
which works but this does NOT
@page :nth(n+1)


All I want to do is not have the page header show up on the first page.


Thanks for the help.
mn4367
This is an example which disables the content property on the three areas above the first page (header):
@page:first {
  @top-left {
    content: normal;
  }
  @top-center {
    content: normal;
  }
  @top-right {
    content: normal;
  }
}

You could also modify other properties there which might have been set for 'regular' pages, like borders which are often used to draw lines below the header.
cscalfani
The following does NOT work:
@page {
    @top { content: flow(header); }
    @bottom { content: flow(footer); }
    size: landscape;
}

@page:first {
    @bottom { content: flow(footer); }
    size: landscape;
}

What am I missing?
mn4367
'@top' is an alias for '@top-center', is that what you want to have? As far as I know, if you want to set the page layout with with 'size:' you also need to give the size, for example 'size: a4 landscape;' or 'size: b6 portrait;'.
cscalfani
I want the header to not show on the first page. That's all.

I get the header on every page using the aforementioned code.
mn4367
OK, I think I misunderstood your CSS, sorry.
If you have set the header with something like
@page {
    @top { content: 'my content'; }
}

you have to explicitly unset it with
@page:first {
    @top { content: normal; }
}

for first pages. It is not sufficient to just remove the style rule in the '@page:first' selector. It will remain active for every page as long as you don't override it with a new/other rule.

cscalfani
Works beautifully. Thanks.