Copy link to clipboard
Copied
Greetings,
Generating CHMs with RH 8.0.2.208 under Windows XP.
I am trying to clean my CSS, so I removed the font-size line from the definition of "P", reasoning that it could be inherited from "BODY".
This worked fine except in tables, where the font jumped from 10 to 12 points.In the WYSIWYG editor and the View (Ctrl-W) it displays correctly, only in the CHM it is wrong. The display of the HTM files is also good in Firefox and Internet Expolrer 7.
I decompiled the CHM and peeped into the code. The differences between the original and decompiled topics were not great, so I tested them one-by-one.
It turns out to be the header:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
... which is good (displays in Verdana 10), while:
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
... is bad (displays in Verdana 12).
Oddly enough, no header at all (ie only the <html> entry) is also bad.
I don't seem to be able to attach files, so here are what I think are the relevant parts of the CSS file:
BODY {
font-family: Verdana, sans-serif;
font-size: 10pt;
color: #000000;
background-color: #ffffff;
}
P {
margin-top: 5pt;
margin-bottom: 0pt;
}
I have a workaround, which is to add font-size: 10pt; to the CSS, but does anyone know why this is happening?
--- Derek
Copy link to clipboard
Copied
Hi,
This is because the doctype is pushing IE into quirks mode. This means, for example, that inheritance is even worse than normal. See http://www.quirksmode.org/css/quirksmode.html. The problem you are experiencing is explained at the bottom of the page.
Greet,
Willam
Copy link to clipboard
Copied
Thanks Willam, ik wist ik kon vertrouwen op jou!
I was wondering, would a line something like:
td {font-size: 100%}
in the CSS help? The idea being to set table cells to be exactly like body text.
--- Derek
Copy link to clipboard
Copied
Hi,
Ik weet niet of ik wel zo betrouwbaar ben In ieder geval altijd leuk om een Nederlander te spreken, al is het dan in het Engels.
That would only work if you set the font size of the table to 10pt, otherwise the td will inherit the wrong value from the table. Try setting the font size of the table and see if that solves the issue.
Greet,
Willam
Copy link to clipboard
Copied
Hi,
I tried
TD {font-size: 10pt;}
but that locked the font in all tables to 10pt; I could not select any other size. Seems I'll have to live with explicitly specifying the font size in my paragraph definitions.
Thanks anyway for your help,
--- Derek
PS My passport says I'm English, but after 30+ years here I guess I'm more Dutch than English. Fijne feestdagen!