CSS PDF - Styling by ID
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 9
- Joined: Wed Jul 11, 2018 11:19 pm
CSS PDF - Styling by ID
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:
That also did not work. Is this a bug or am I crazy?
Thanks!
Code: Select all
*[class~="reference/reference"][id~="reference_a7Hj8K1"]{
background-color: red;
}
Thanks!
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: CSS PDF - Styling by ID
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 or
- in your CSS, in case you use the HTML5 and CSS scenario, you should use
and for the DITA and CSS (WYSIWYG), the selector would slightly change in: .
I hope this helps!
Costin
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>
Code: Select all
*[class~="reference1"]{
background-color: red;
color: cyan;
}
Code: Select all
*[outputclass~="reference1"]
I hope this helps!
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: CSS PDF - Styling by ID
Hi,
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:
https://www.oxygenxml.com/doc/versions/ ... e_css.html
Regards,
Radu
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:
https://www.oxygenxml.com/doc/versions/ ... e_css.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9
- Joined: Wed Jul 11, 2018 11:19 pm
Re: CSS PDF - Styling by ID
I am using 19.1. I can use outputclass, but it is just redundant for the ID.
Here is the thing I am trying to do in a nutshell. I want to apply fonts that only work on elements in a certain section. It seems to me if I could code a selector that chose the id of the topic that content is in, and also the class attribute on the element I want to format, that should be good.
I have to move on and outputclass works for now. Maybe I will try upgrading, but I don't really understand why this wouldn't work.
I'll try to update when I get upgraded.
Here is the thing I am trying to do in a nutshell. I want to apply fonts that only work on elements in a certain section. It seems to me if I could code a selector that chose the id of the topic that content is in, and also the class attribute on the element I want to format, that should be good.
I have to move on and outputclass works for now. Maybe I will try upgrading, but I don't really understand why this wouldn't work.
I'll try to update when I get upgraded.
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