0

I have found lots of guides and examples on how to make dropcaps with CSS, but they all fail when used with very short paragraphs. The concept is simple:

<style>
p::first-letter {
  float: left;
  font-size: 48pt;
}
</style>
<p>
  Lorem ipsum dolor sit amet,
</p>
<p>
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</p>

https://codepen.io/MadsSkjern/pen/vYLPaVo

Works well most of the time

enter image description here

But not with short paragraphs

enter image description here

How can I make a solution that also works with short paragraphs?

Mads Skjern
  • 5,648
  • 6
  • 36
  • 40

0 Answers0