Quantcast
Channel: MobileRead Forums - Kindle Formats
Viewing all articles
Browse latest Browse all 861

:first-letter selector support in KF8

$
0
0
After reading PoP's post about his 2D Transforms tests support in KF8, I did some tests too and found out that KF8 actually supports the :first-letter selector even though the Kindle Publishing Guidelines say it doesn't
I used the following style to format the first letter of the first paragraph after the heading:

Code:

p:nth-child(2):first-letter {
    font-family: sans-serif;
    float: left;
    font-size: 4em;
    font-weight: bold;
    margin-top: -0.2em;
    margin-bottom: -0.2em;
    margin-right: 5px;
    color: red;
}

The :first-letter selector makes it easy to add dropcaps to ebooks with lots of chapters in them without having to mark the first letter of the paragraph. (KF8 also supports text-transform and text-shadow as my cheesy heading example demonstrates.)

tl:dr some CSS3 styles that have so far only been available in iBooks ePubs can also be used in KF8 books.

Attached Thumbnails
Click image for larger version

Name:	K3.JPG
Views:	N/A
Size:	106.0 KB
ID:	105357   Click image for larger version

Name:	K4PC.JPG
Views:	N/A
Size:	79.7 KB
ID:	105358  
Attached Files
File Type: epub pseudo_firstletter.epub (2.9 KB)

Viewing all articles
Browse latest Browse all 861

Trending Articles