Page 1 of 1

problem line break front-page dita css pdf

Posted: Thu Sep 14, 2023 2:47 pm
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

Re: problem line break front-page dita css pdf

Posted: Thu Sep 14, 2023 3:00 pm
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

Re: problem line break front-page dita css pdf

Posted: Fri Sep 15, 2023 1:04 pm
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