Dropcaps done in CSS (example)


DropCap.hype.zip (119,0 KB)

Updated: Now supports paragraphs and single text.


I just glanced at this thread, but I was surprised that this is still a challenging issue.

Whoa, that’s lousy support for Initial Letter…

It basically works in macOS / Safari though…

.drop-cap:first-letter {
-webkit-initial-letter: 3;
margin-right: 5px;
1 Like

First-Letter on the other hand is widly supported

Good article on the matter:

You can also skip the div tag formatting in the innerText.

		font-family: "Playfair Display", serif;
		font-size: 5.5rem;
		float: left;
		line-height: .6;
		margin-right: 0.05em;
		margin-top: 0.1em; 

Just seen thats what @Photics is also pointing out…

Doesn’t work @MarkHunte. At least not in my example with two pasted paragraphs.

This covers both cases:
.dropcap div:first-child:first-letter, .dropcap:first-child:first-letter

I updated the example.

I think that the innerHTM div tags are the issue. With them removed.

DropCap 2.hype.zip (118.8 KB)

But bothoth ways work.
Just thinking not everyone would want inner formating. But you may not be able to escape that in a single text box if you want line breaks.

Using pasted text which comes with formatting may also be unpridictable in what tagsand children it has.

I just pasted two paragraphs. No HTML was in them. The DIVs are added by Hype so I consider it the default a user is going to encounter. Only doesn’t happen if you paste through the little pen icon, but then the second rule in the corrected file above should kick in now. Not in the video (that’s the version wit only one selector). So double the selector and we are fine! Anyways it’s a tips & tricks template. So tweaking is welcome!

Got ya.