View Single Post
Old 03-03-2020, 12:53 PM   #12
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 329
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
The code for what you want to do can be much simpler. And I would get rid of the red for sure. If you want just a larger first letter, here is a simple CSS code to do that. I've only named it "dropcap," so I can find it easily in my template file when fixing tons of dropcaps in books that need fixing.

.dropcap {
display: inline;
font-weight: bold;
font-size: 2em;
line-height: 0;
}
__________________
With several of mine you do not have to add anything into the xhtml at all. The CSS puts the dropcap after, say, every H1 and H2. Others of them will put a dropcap after headers, OL, img, etc, as you like. Mine also will pick up initial quotation (but not following superscripts). If the book has a hundred chapters, you don't have to touch the text at all. It's just automatically put in. CSS will not allow a construction such as (h1 ~ p):first-of-type nor does it do 'first-of-class'. There is a proposed code (not yet implemented) called 'initial-letter' (instead of first-letter). It calculates size and drop automatically. Until it comes out combinators rule the day! Best regards, Pop
rjwse@aol.com is offline   Reply With Quote