Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing header on reports by defining a html tag/id #request #1140

Closed
bjornasm opened this issue Jun 13, 2020 · 3 comments
Closed

Changing header on reports by defining a html tag/id #request #1140

bjornasm opened this issue Jun 13, 2020 · 3 comments
Labels
CSS Questions about how to do something with CSS

Comments

@bjornasm
Copy link

bjornasm commented Jun 13, 2020

Right now, when I use the reports template, the upper rightmost header text is the same as the chapter <h2> header text. However, I rather want an uniform header text (f.ex date and company name). It would be great if you could define a <p class="header">headertext</p> that was invisible, but was put in place as the header text by WeasyPrint.

@liZe
Copy link
Member

liZe commented Jun 14, 2020

Hi!

I think that what you want is running elements, and … it’s already in WeasyPrint 😉.

Let me know if it works for you!

@Tontyna
Copy link
Contributor

Tontyna commented Jun 14, 2020

Running elements is what you are looking for:

  @page { 
    @top-center { content: element(myheader) }
  }
 .header { 
    position: running(myheader); 
 }

@bjornasm
Copy link
Author

Thank you- that is 100% what I was after. Came in here to close this, sorry for this.

@liZe liZe added the CSS Questions about how to do something with CSS label Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Questions about how to do something with CSS
Projects
None yet
Development

No branches or pull requests

3 participants