CSS PDF - Styling by ID

Posts: 1

CSS PDF - Styling by ID

Thu Jul 12, 2018 7:52 pm

Is it possible to select the attribute to style content. I have an ID in a reference and I cannot style it. I tried setting my selector for the reference/reference class and that worked, but it selected all references. Then I tried this:

Code: Select all


    background-color: red;


That also did not work. Is this a bug or am I crazy?

Posts: 365

Re: CSS PDF - Styling by ID

Thu Jul 12, 2018 9:13 pm

Hi CarlosM,

What version of oXygen are you using? Are you on the last version available?
Also, what specific transformation scenario are you applying? Is it DITA Map PDF - based on HTML5 and CSS, or the DITA Map PDF - based on DITA and CSS (WYSIWYG)?
Also, what type of reference do you have? Is it a conref / xref (with href or keyref)?

It would help us investigate if you could send a sample DITA Map in a minimal form rhat reproduces the issue on our support email - support@oxygenxml.com (together with your CSS file).

Meanwhile, you could try using the outputclass attribute instead the ID.
More specific, on the reference (conref / xref element), you should set an "outputclass" attribute, which you could then match the resulted class in the output through your customization CSS and style it as you wish.
For example:
- in your source dita file you could have

Code: Select all

<p conref="your/referred#content" outputclass="reference1">Referred content</p>

Code: Select all

<xref keyref="your/referred/content" outputclass="reference1"></xref>

- in your CSS, in case you use the HTML5 and CSS scenario, you should use

Code: Select all

    background-color: red;
    color: cyan;

and for the DITA and CSS (WYSIWYG), the selector would slightly change in:

Code: Select all


I hope this helps!
Costin Sandoi
oXygen XML Editor and Author Support
Posts: 5563

Re: CSS PDF - Styling by ID

Fri Jul 13, 2018 7:42 am


Also whenever you try to style content using CSS it will help you if you know exactly the merged XML document over which the CSS is applied:


Radu Coravu
<oXygen/> XML Editor

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 0 guests