Left and Right Page Headers: :left and :right

You can set left and right margins as well as headers and footers[4] separately for left and right pages. These may be different again for the first page. You can also hide the titles and page number from the left-hand side of the left pages and the right-hand side of the right pages when it is the first page.

When used together with named pages, the style of the left and right pages and of the first page of each named page can be specified.

@page Chapter:left {     /* left page setting */
  margin-left: 23mm;
  margin-right: 27mm;

  @top-left {     /* book title in the running head of the left page */
    content: string(Title);
  }
  @bottom-left {  /* page number */
    content: counter(page);
  }
}

@page Chapter:right {    /* right page setting */
  margin-left: 27mm;
  margin-right: 23mm;

  @top-right {    /* section title in the running head of the right page */
    content: string(Section);
  }
  @bottom-right { /* page number */
    content: counter(page);
  }
}

@page Chapter:first {    /* setting of the first page of a Chapter */
  /* hide page header */
  @top-right { content: none }
  @top-left  { content: none }
}

Figure 9. Three pages with different headers and footers

Three pages with different headers and footers