DocBook: css has no effect

Oxygen general issues.
pwatt
Posts: 13
Joined: Thu Oct 01, 2009 9:53 pm

DocBook: css has no effect

Post by pwatt »

Hi,

I have written a user guide in DocBook and output it as PDF and HTML using the Oxygen transformation scenarios. I've tweaked the PDF xsl files a bit and they have the desired effect.

Now I'm trying to improve the appearance of the HTML output. I prepared a simple css and specify the filename in the parameter html.stylesheet in the HTML transformation scenario. For example, I just try to change the color of the font. I've tried putting various stuff in the css, but it is not applied. Here's the latest version:

div.chapter div.titlepage h2 {
font-size: 180%;
font-family: Helvetica;
font-weight: Bold;
color: green
}

Can you please give me a simple code to put in the stylesheet to make the titles green--it is Saint Patrick's day, after all

Thanks,
Patricia
Radu
Posts: 9508
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook: css has no effect

Post by Radu »

Hi Patricia,

If you are transforming a Docbook book (with chapters) and you want to make green only the chapter titles your CSS seems fine.
Another way to make all titles green would be something like:

Code: Select all


h2.title{
font-size: 180%;
font-family: Helvetica;
font-weight: Bold;
color: green
}
The problem is that probably the created HTML document references to the CSS file with the wrong location (the browser does not report any error in case the CSS is not found).

What you can do is open the output HTML in Oxygen and look for the link to the CSS like:
<link rel="stylesheet" href="test.css" type="text/css">

The link path should be relative to the HTML file.

Unfortunately the fix will not be available in time for Saint Patrick's day. :)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pwatt
Posts: 13
Joined: Thu Oct 01, 2009 9:53 pm

Re: DocBook: css has no effect

Post by pwatt »

Hi Radu,

Thanks--it worked! I had put an absolute path--and I guess I didn't have the leading slashes and whatnot right.

A la prochaine!
Post Reply