Quote:
Originally Posted by JSWolf
It's not Calibre's fault you botched the CSS. <div class="center"> is going to do nothing because you don't have any class in the CSS for that.
|
That's the basic point: calibre is happy if any definition for a class name (in my example p.center) used in the html exists in the css, even if the class definition in the css has no effect on other elements using a class with the same name (<div class="center"> in my example).
Therefore, although the <div class="center"> is not doing anything, since the corresponding definition is missing in the css, calibre is not removing the "center" class from <div class="center"> since the CSS contains a p.center defintion, which, as pointed out, has no effect on the <div class="center">
So when you use the calibre tool, you assume that all classes in the html have a corresponding defintion in the CSS even if this is not the case.
P.S.
I didn't botch the CSS. I downloaded the book and checked the book for errors. During the check I noticed by coincidence that the html contains both <div class="center"> and <p class="center"> and that calibre does not remove the class from <div class="center">, since the CSS contained a p.center definition.