Forum Bugs

Problem with counter-reset

pkj
Hi,

With 6.0 rev 5 I am using the following CSS to reset the page counter:

#part162484 {
counter-reset: page 1;
}

It always creates a blank with the old page number in the footer before correctly resetting the page counter on the next page. (It does not create a blank page if I reset a counter other than page.)

Is that a bug / intended behaviour / something else wrong with my CSS?

Thanks

Peter
pkj
Hi Mike,

Any news on this one? Sorry to nag to but I have a client that is waiting for an answer.

Regards

Peter
mikeday
Sorry for the delay. Resetting the page counter should create a page break, but it should not leave a blank page. For example:
<p>First page</p>
<p style="counter-reset: page">
Second page!
</p>

This document should end up with two pages. What content is preceding the block that resets the page counter in your document?
pkj
Mike,

In light of your response, I know what caused the blank page - my CSS.

Does resetting the page counter really need to cause a page break? I think it would be more flexible to just reset the page counter on the current page and let people trigger a break if they want to.

Anyway, I have found the correct CSS to sort out my numbering which I am pleased with because it involves a few of the less usual selectors.

My HTML:

<div id=coverPage>This is the cover page</div>

<h1>Heading 1</h1>
<p>Content here</p>

<h1>Heading 2</h1>
<p>Content here</p>


The CSS I use:

h1 {
	page-break-before: always;
}
#coverPage h1 {
	page-break-before: auto;
}
#coverPage ~ h1:first-of-type {
	counter-reset: page 1;
}


The CSS is more complex than perhaps it might be just in case there are any <h1> elements in the coverpage.

Regards

Peter