problem line break front-page dita css pdf

Post here questions and problems related to editing and publishing DITA content.
Ecumaster
Posts: 11
Joined: Thu Jul 06, 2023 5:31 pm

problem line break front-page dita css pdf

Post by Ecumaster »

Hello,

I have a problem with line-break. Here's the code that generates title-page:

/* this fragment formats the title taken from ditamap name*/
*[class ~= "front-page/front-page-title"] {
position: absolute;
left: 30px;
top: 470px;
color: black;
font-size: 24pt;
width: 1000px;
}

/* this fragment formats the addition line defined in scenario */
*[class ~= "front-page/front-page-title"]:after(1) {
content: oxy_xpath('/*/@*[local-name()="doc-version"][1]');
}

/* this fragment formats yet another addition line defined in scenario */
*[class ~= "front-page/front-page-title"]:after(2) {
content: oxy_xpath('/*/@*[local-name()="soft-version"][1]');
}

/* this fragment formats picture defined in scenario */
*[class ~= "front-page/front-page-title"]:after(3) { /* this fragment formats the picture defined in scenario */
width: 620px;
content: url(oxy_xpath('/*/@*[local-name()="front-page-product"][1]')); /* źródło obrazka definiowalne w Transformation Scenario w Parameters */
display: block;
background-repeat: no-repeat;
background-size: 100%;
}

The problem is that the additional line defined in: *[class ~= "front-page/front-page-title"]:after(2) is rendered in the same line:
Screenshot.jpg
You do not have the required permissions to view the files attached to this post.
Wojtek
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: problem line break front-page dita css pdf

Post by julien_lacour »

Hi Wojtek,

The problem is that both after(1) and after(2) rules define content but not display whose initial value is inline.
If you set display: block on both rules, you should obtain the desired output.

Regards,
Julien
Ecumaster
Posts: 11
Joined: Thu Jul 06, 2023 5:31 pm

Re: problem line break front-page dita css pdf

Post by Ecumaster »

Hi Julien,

it works, thanks!
however a little feedback. When I set display: block in both rules, the second line did not render at all. After some trial and error, this is the code that works:

*[class ~= "front-page/front-page-title"]:after(1) {
content: oxy_xpath('/*/@*[local-name()="doc-version"][1]');
font-size: 12pt;
display: block;
}

*[class ~= "front-page/front-page-title"]:after(2) {
content: oxy_xpath('/*/@*[local-name()="soft-version"][1]');
font-size: 12pt;
text-align: right;
}

So block only in :after(1) rule. The rest of the code is the same as pasted in the first post.
Wojtek
Wojtek
Post Reply