Forum How do I...?

Two level page headers

fmkatz
I am prince-ing a book with parts and chapters; trying to get the part titles as the headers on the
left hand pages and the chapter titles on the right hand pages.

The chapter heads work, but the part headers only show up through the first chapter of each part; then they disappear.

I am using the following code:

h1[title] {string-set: pheader attr(title) }
h2[title] {string-set: cheader attr(title) }


@page maintext :left {
@top-left {
content: counter(page);
}
@top-right {
content: string(pheader, first);
}
}

@page maintext :right {
@top-left {
content: string(cheader, first);
}
@top-right {
content: counter(page);
}
}

(Tried last and start instead of first; didn't make a difference.)

Any suggestions on how to make this work?

Thanks
fmkatz
Never mind.

I found the trick in an old posting/reply. I can put a hint in the HTML <head>:
<meta name="left_header" content="PART TITLE (or BOOK TITLE)"/>

And, then:

meta[name='left_header'] {string-set: pheader attr(content) }


I would still like to know why the old version didn't work; but, this works well enough for
present purposes.
mikeday
This CSS looks fine, so I'm not sure why it didn't work. If you have a simple sample document you can email me (mikeday@yeslogic.com) and I can take a look.
fmkatz
Thanks for the offer.
The document I have is not simple; I'll try to cut it down to something that isolates the issue.