Page 1 of 1

DocBook: css has no effect

Posted: Wed Mar 17, 2010 8:45 pm
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

Re: DocBook: css has no effect

Posted: Thu Mar 18, 2010 12:16 pm
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

Re: DocBook: css has no effect

Posted: Thu Mar 18, 2010 4:39 pm
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!