Meaning of value for class property

Oxygen general issues.
altein
Posts: 13
Joined: Mon Jan 18, 2010 4:32 pm

Meaning of value for class property

Post by altein »

Hi,
I am working with DITA, and I want to be able to control the layout of my webpages page using div tags, and float properties, etc. Two questions:

I noticed that the elements in topics have a class (in the properties panel of Oxygen) of -topic/p, or -topic/[whatever the tag].

I noticed that when I view the HTML source files of the sample IT-Book project (after the project is built), <div> tags surround all groups of <p> tags in the body, but I cannot find where this is specified in the CSS -- I noticed the HTML had a reference to commonltr.css. I'd like to convert the body content into a specific page layout using stylesheets. How to I get control of the <body> elements so I can style them?

Thanks,
Allan
I think I may have been unclear in my last posting. I have a quite simple question, I think. What is the meaning of the value for the "class" property in the properties panel?

I am working with DITA templates -- concepts, tasks, references. I noticed that when I click on an element in the XML, for example the <body> element within a concept topic, the value for the class property in the properties panel displays a corresponding value of "-topic/body", and the same with other tags: <shortdesc> produces "-topic/shortdesc".

What do these values refer to?

Thanks,
Allan
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Meaning of value for class property

Post by Radu »

Hi Allan,

I joined both your posts into one, hope you don't mind.
The class attributes on DITA elements were not added for CSS styling but for allowing DITA specializations. For example if you have two tag names but both have the same class value they are equivalent and are published in the same way.
See this link for more details:
http://docs.oasis-open.org/dita/v1.0/ar ... ssatt.html

If you want to match the generated XHTML content more precisely based on the element class from which they were generated, in the DITA Transformation Scenario in the Parameters tab you can set the args.xhtml.classattr parameter to Yes.

This will generate for each XHTML element a class attribute containing the original class value from the original DITA element.
You can match these attribute in a CSS file like:

Code: Select all


div[class~="body"]{
background-color:red;
}

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply