Forum How do I...?

Page Level Padding?

alexmilowski
I have a stylesheet that added padding to the top of the HTML5 article element. Within the page sequence that it generated, there was the same padding at the top of each page.

Is this expected?

I had expected just just the padding at the start of the article's page sequence rather than on each page.

The rule was similar to:

article {
padding-top: 5em;
}
jim_albright
Try adding color to the different areas so you can actually see what is happening. You have different places that padding is applied.

Jim Albright
Wycliffe Bible Translators

alexmilowski
Well, I know what is happening in that the articles top padding is being added to the top of every page. What I don't understand is why that would happen.

I don't see anything in the CSS Page Media Module [1] that would say that this should happen but I haven't made a careful study of all the specifications together.

I've solved my problem by moving the padding to a top margin of the first child. This is fine for what I am doing but I'd really like to understand the behavior.

[1] http://www.w3.org/TR/css3-page/
mikeday
Currently Prince repeats borders and padding on each page that an element appears on. You can use "box-decoration-break: slice" to prevent this. One difference from the CSS spec is that the spec defaults to "slice", while Prince defaults to "clone" for historical reasons.
alexmilowski
OK. After reading the specification [1], this makes sense. Thanks!

[1] http://www.w3.org/TR/css3-background/#box-decoration-break