Quote:
Originally Posted by nabsltd
h2.chapterheader {} only applies to the h2 element. If you decide that you need to move levels up or down in the heading structure (i.e., h1 becomes h2 or h2 becomes h1), you need to go back and change the stylesheet, becauset the old h2.chapterheader {} won't apply to an h1.
On the other hand, if your stylesheet only referenced .chapterheader {}, then it doesn't matter if that class name is in an h1, an h2 or even a p, it will still get applied.
|
I agree. That;s why I dislike things like p.center and h2.chapterheader. I see no reason to to it that way. I prefer classes that can be used anywhere you want.
Quote:
h1.specialchapter has to "undo" everything that the bare h1 declares if it doesn't match what you want h1.specialchapter to look like. You either do this by making h1.specialchapter declare all properties or by just declaring what needs to change.
In the first case, you aren't using the base h1 at all in h1.specialchapter, so why pretend it's related to the base? In the second case, if you change the base h1, then h1.specialchapter will also change, if you didn't override that property. If that's not what you want, you have to change both declarations.
My way means I only change the declaration I want to change, and don't have to worry about any other side effects. Part of the reason I do this is because physical books often had what would be h1 and h2 in an EPUB having formatting that has nothing at all in common. For example h1 was a fairly large sans-serif font centered (the chapter number) with a very large bottom margin, while h2 was left-justified, italic, and only slightly larger than the body text, and a normal bottom margin ("datelines" that occured 3-4 times per chapter).
|
I disagree. I prefer <h2>Chapter 01</h2>. In most cases, that's all I need. And if not, I don't mind doing what need to be done in CSS to get the class to work.