0

I have defined @page :left and :right margins like this:

@page :left {
  margin-left: 0.75in;
  margin-right: 0.25in;
}

@page :right {
  margin-right: 0.75in;
  margin-left: 0.25in;
}

When I print using Chrome it always seems to start the document with the :left rules.

Is there a way to have printing start with the :right rules?

I'm most interested in a solution for Chrome, but I'd also be interested in solutions for Prince.

ErikR
  • 51,541
  • 9
  • 73
  • 124
  • Why not just swap the rule styles? Just have `:left` have a wider right margin. – Joseph Marikle Jul 11 '17 at 19:38
  • 1
    FYI: Prince appears to allow you to effectively swap the values of the two `:left` and `:right` rules: https://www.princexml.com/forum/topic/77/wrong-margins-on-the-page-left-and-page-right#15446 – Joseph Marikle Jul 11 '17 at 19:48
  • And that also seems to work in Chrome! If you want to write it up I'll accept it. – ErikR Jul 11 '17 at 20:05

3 Answers3

1

You can use the page-break-before css property to adjusts page breaks in both Chrome and Prince (apparently).

Joseph Marikle
  • 76,418
  • 17
  • 112
  • 129
0

CSS stands for "cascading style sheet" and the "cascading" means that it's read from top to bottom. If you simply switch the order of your statements, it should read right first.

Allball103
  • 131
  • 8
0

Placing the @page :right above the :left should do it.

@page :right {
  margin-right: 0.75in;
  margin-left: 0.25in;
}

@page :left {
  margin-left: 0.75in;
  margin-right: 0.25in;
}
altShiftDev
  • 1,564
  • 1
  • 9
  • 20