Forum How do I...?

add a horizontal line between two elements only when they are on the same page

esef
I want to add a horizontal line as a spacer between two elements.

I have a working solution based on prince discarding margins, but that works only with forced breaks.

How can I do that with breaks that prince adds?

See attachment for example rendering.
  1. spacer.png61.5 kB
mikeday
There isn't a CSS mechanism for controlling appearance based on page breaks like this, so I think at the moment it will require a multi-pass mechanism using JavaScript to scan the converted document and identify spacers that appear at the top of a page and change their style to be invisible.