Span with first-letter css-class is not added to ePub on Compile


Opening the result from compiling to ePub3 in Calibre reveals the span with first-letter css-class is never added to the ePub on Compile. I’m trying to create an example of how Drop Caps would work. I’ve tried three times with the same result. It would work admirable if a span was actually generated in the output. When I insert the span with the class and add the relevant CSS to the stylesheet, the e-book shows the Drop Cap perfectly:

Am I missing a requirement for the span to show up, or is this a bug?

Don’t know about Windows, but the attached sample project works on macOS. Might not be the solution you want, but…

Hope a Windows user can come up with a better solution for you.

Merx (77.5 KB)

I just came across an issue in another thread—for some reason the option that adds a “first-letter” class to a span doesn’t do so, it adds a “drop-cap” class to a span. I suspect you’re seeing something slightly different though, as you would have noticed that in the HTML.

In addition to the sample project provided above, here is another, where I described how to add drop caps as well.

Considering that this will be fixed at some point, I recommend using a .drop-cap, .first-letter {...} selector, for now.


Sorry, can’t find a drop-cap css-class either. There’s nothing there. Is it me?

Do either of the test projects work? I’m wondering if maybe there is some peculiarity of the layout assignments or binder structure that is causing that. Comparing with a working example might help.

Well, Merx’s test project works obviously for ALL spans in the e-book. In THAT e-book the first-letter class actually exist, but it isn’t used and there’s only one span in the entire e-book.

In MY Compilation of the same project, the first-letter class does not exist.
The title is in a span, as is the link Elicit – rightfully commented upon – , as well as its italic title, and the comment in the CSS part is in a span, thus they are all in glorious uppercase red American Typewriter letters, borders and 4rem and all.

I’m using a Section Layout with a headed section, not a separate bordered Chapter Heading and a Section Text, as Merx does. In my case it’s one section of many in a chapter. I also include the eBook front matter.

I’ve tried several other Section Layouts, but to no avail. This is the HTML I get:


I can find no other project in your linked forum thread, or the linked thread in that thread.

I can only conclude that in Windows projects the Add “first-letter” span style to first letter option does nothing.

From the page Ioa linked above:

File here.


All right, I see the problem (and retract my earlier comment about the class name being wrong). That was a side-effect of another technique I was demonstrating. It looks like I can’t get any response out of the checkbox no matter the settings I use. I’ve adjusted my report to the developers and increased its priority.