View Single Post
Old 05-06-2013, 08:38 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Apparently, KF8 supports quite a number of pseudo classes. I tested a couple more of them that I thought might be useful for automatically applying styles to unformatted paragraphs and found out that at least the following pseudo classes work:

:after
:before
:first-letter
:first-line
:first-of-type
:last-of-type
:lang(xx)
:nth-child(n)
:nth-child(even)
:nth-child(odd)
:nth-of-type(n)
:only-of-type

IMHO, some of them are redundant, while others provide useful automated formatting options. For example, you can use p:first-of-type:first-letter instead of explicitly selecting the paragraph by number with p:nth-child(2):first-letter to apply a dropcap style. You can also zebra-stripe table rows with :nth-child or insert text or images with :before and :after.

(I've attached the updated epub, which passes epubcheck, compiles without warnings but doesn't work with ADE, to the first post.)
Note that the text and symbols displayed in red in the KFPC screenshot have been created without modifying the .html file and without embedded fonts/images.
Attached Thumbnails
Click image for larger version

Name:	K3.JPG
Views:	477
Size:	79.5 KB
ID:	105474   Click image for larger version

Name:	KindleForPC.JPG
Views:	494
Size:	155.8 KB
ID:	105475  

Last edited by Doitsu; 05-06-2013 at 01:14 PM.
Doitsu is offline   Reply With Quote