Styling with CSS Hovertext in html output

Post here questions and problems related to editing and publishing DITA content.
eloralon
Posts: 38
Joined: Thu Oct 28, 2010 5:10 pm

Styling with CSS Hovertext in html output

Post by eloralon »

Hello,

I am now able to show the hovertext with the help of oXygen XML support team.

I need to style the hovertext for instance change the background color of the text box from yellow to some different color, adjust the text indentation and padding as well as change the box border properties...

Would you please show me how/where to make the changes for the above properties?

Thanks
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Styling with CSS Hovertext in html output

Post by sorin_ristache »

Hi,

The tooltip appearance is browser dependent. For example in Firefox I have a gray background on the hover text, not yellow. You can however set the text in a different attribute, for example data-title, and set the hover style on that attribute. You can find some details here.


Regards,
Sorin
eloralon
Posts: 38
Joined: Thu Oct 28, 2010 5:10 pm

Re: Styling with CSS Hovertext in html output

Post by eloralon »

Thanks Sorin,

Can you provide a simple example of what you meant in the context of oXygen XML. I have read the reference thread you pointed out in your reply.

Where can I make a change inside the oXygen provided CSS or XSLT to get to style the text like the one you mentioned (data-title).

Thanks
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Styling with CSS Hovertext in html output

Post by sorin_ristache »

Hi,

You can add your CSS customizations for the hover popup style to the CSS file [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\css\webhelp_topic.css which is included in every HTML output file of the DITA Webhelp transformation or you can create your own CSS file and set it in the args.css parameter of the DITA Webhelp transformation.

If you want to go the way of adding an attribute data-title to the <a> element corresponding to a glossary term then you have to add this attribute by modifying the template

Code: Select all

<xsl:template match="*[contains(@class,' topic/term ')]" name="topic.term">
from file [Oxygen-install-dir]\frameworks\dita\DITA-OT\xsl\xslhtml\dita2htmlImpl.xsl. There is an element <a> with an attribute title="{$hovertext}" constructed inside this XSLT template.


Regards,
Sorin
Anuradha
Posts: 10
Joined: Mon Sep 15, 2014 9:52 am

Re: Styling with CSS Hovertext in html output

Post by Anuradha »

Hi,

I use <oXygen/> XML Author 14.2 and the output help that i build is Eclipse and Webhelp.

I would like to show hovertext for some definitions and short descriptions of terms in my output. Could you please explain how to do that?


Thank you
Anuradha
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Styling with CSS Hovertext in html output

Post by Radu »

Hi Anuradha,

You probably need to perform some XSLT customization and set the title attribute on the HTML reference with a custom value derived from the shortdescription.
Maybe you could ask about this on the DITA Users List:

https://groups.yahoo.com/neo/groups/dita-users/info

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Anuradha
Posts: 10
Joined: Mon Sep 15, 2014 9:52 am

Re: Styling with CSS Hovertext in html output

Post by Anuradha »

Sure. Will do that.

Thank you
Anuradha
Post Reply