To achieve a specific header for the chapter
Posted: Mon Jan 09, 2023 2:25 pm
Hello Team,
I am trying to create CSS for this chapter header
I am using the following code
The output I got was
I was able to get the required contents. But, how to have different formatting for "Chapter" and "counter of chapter" like 1, 2, 3... Because the requirement is to have font color of "Chapter" is black and the font color of "1" is white. Here is where I am stuck.
If anyone can provide the details, it will be really helpful.
I am trying to create CSS for this chapter header
I am using the following code
Code: Select all
@page chapter:first:left {
size: A4;
padding:0%;
margin-top:3cm;
margin-bottom: 2cm;
margin-left: 1.06cm;
margin-right: 0.81cm;
/* border: 0.1cm dotted red;*/
@top-left {
content: "Chapter\A0\A0\A0\A0\A0" string(chaptertitle)"\A0\A0\A0";
background-image: url(../images/FirstPageHeaderBlock.png);
background-repeat: no-repeat;
background-position: 0 0.5cm;
background-size: 100% 100%;
margin: 0cm;
text-align:right;
font-weight: bold;
font-size: 24pt;
border: 0cm;
}
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
string-set: chaptertitle counter(chapter);
}
I was able to get the required contents. But, how to have different formatting for "Chapter" and "counter of chapter" like 1, 2, 3... Because the requirement is to have font color of "Chapter" is black and the font color of "1" is white. Here is where I am stuck.
If anyone can provide the details, it will be really helpful.