Quote:
Originally Posted by paperwhite13
This is also something I don’t understand yet, sorry  Especially the 'why bother restricting' part. Do you mean you could reuse the class for the other headings?
|
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.
Quote:
Why not use the bare (L.E.: styled) h1 for the normal chapter, and h1.specialchapter for the rest? Why is there a need for a h1.normalchapter?
|
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).