How to display all page header and footers to right side
Post here questions and problems related to editing and publishing DITA content.
How to display all page header and footers to right side
I am customizing my page header and footer with a css file for DITA Map PDF and here are my codes:
However, I noticed these page headers and footers only display right on odd pages, but display left on even pages. How to customize the code to display all headers and footers to right side?
Code: Select all
@page :right, table-of-contents:right, chapter:right {
@top-right {
content: string(parttitle-no-prefix) " | " string(chaptertitle-no-prefix);
}
}
@page :right, table-of-contents:right, chapter:right {
@bottom-right {
content: counter(page);
}
}
-
- Posts: 605
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to display all page header and footers to right side
Post by julien_lacour »
Hello,
You only define the headers/footers for the right-hand pages (see https://developer.mozilla.org/en-US/docs/Web/CSS/:right for more information), if you want to have the same display on odd and even pages, you should define the same rules for left-hand pages by using the :left pseudo-class.
As a side note, there's no need to redefine the selector for headers and footers, you can group them:
This is controlled directly by the page-margin boxes and you can define all the boxes inside the same @page at-rule (from the moment they need to be applied on the same page of course).
Regards,
Julien
You only define the headers/footers for the right-hand pages (see https://developer.mozilla.org/en-US/docs/Web/CSS/:right for more information), if you want to have the same display on odd and even pages, you should define the same rules for left-hand pages by using the :left pseudo-class.
As a side note, there's no need to redefine the selector for headers and footers, you can group them:
Code: Select all
@page :right, table-of-contents:right, chapter:right {
@top-right {
content: string(parttitle-no-prefix) " | " string(chaptertitle-no-prefix);
}
@bottom-right {
content: counter(page);
}
}
Regards,
Julien
Re: How to display all page header and footers to right side
Thank you for your reply and note. Yes I can also define the same rules for the left hand but is there any solution to display all to right side not left side?julien_lacour wrote: ↑Thu Jul 25, 2024 12:05 pm Hello,
You only define the headers/footers for the right-hand pages (see https://developer.mozilla.org/en-US/docs/Web/CSS/:right for more information), if you want to have the same display on odd and even pages, you should define the same rules for left-hand pages by using the :left pseudo-class.
As a side note, there's no need to redefine the selector for headers and footers, you can group them:This is controlled directly by the page-margin boxes and you can define all the boxes inside the same @page at-rule (from the moment they need to be applied on the same page of course).Code: Select all
@page :right, table-of-contents:right, chapter:right { @top-right { content: string(parttitle-no-prefix) " | " string(chaptertitle-no-prefix); } @bottom-right { content: counter(page); } }
Regards,
Julien
Last edited by youny on Thu Jul 25, 2024 3:40 pm, edited 1 time in total.
-
- Posts: 605
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to display all page header and footers to right side
Post by julien_lacour »
Hello,
I think you are making a confusion here: :left and :right are the pseudo-classes that in CSS matches left-handed or right-handed pages while @top-right and @bottom-right are page-margin boxes inside those pages.
Of course you can define left-handed pages and display header and footer content on the right side:
Regards,
Julien
I think you are making a confusion here: :left and :right are the pseudo-classes that in CSS matches left-handed or right-handed pages while @top-right and @bottom-right are page-margin boxes inside those pages.
Of course you can define left-handed pages and display header and footer content on the right side:
Code: Select all
@page :left, table-of-contents:left, chapter:left{
@top-right {
content: string(parttitle-no-prefix) " | " string(chaptertitle-no-prefix);
}
@bottom-right {
content: counter(page);
}
}
Julien
Re: How to display all page header and footers to right side
You're right. I solved this problem, thank you for your answers!julien_lacour wrote: ↑Fri Jul 26, 2024 1:04 pm Hello,
I think you are making a confusion here: :left and :right are the pseudo-classes that in CSS matches left-handed or right-handed pages while @top-right and @bottom-right are page-margin boxes inside those pages.
Of course you can define left-handed pages and display header and footer content on the right side:Regards,Code: Select all
@page :left, table-of-contents:left, chapter:left{ @top-right { content: string(parttitle-no-prefix) " | " string(chaptertitle-no-prefix); } @bottom-right { content: counter(page); } }
Julien
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service