Today I Learned - Rocky Kev

TIL CSS pseudo-element first-letter, to make a Drop Cap

POSTED ON:

TAGS:

A drop-cap is this:

You can add a drop cap to a paragraph by using the ::first-letter pseudo-element.

p::first-letter {
font-size: 250%;
}

It's accessible! It's also not hacking the page with nasty <span> tags.

REFERENCE:
Accessible Drop Caps


Related TILs

Tagged:

TIL the alternate keyword

If 'alternate' appears along with the stylesheet keyword, the linked file is an alternative stylesheet. It won’t be applied to the document, but it will be ready for when we need it.

TIL Logical Properties

For that sweet sweet Internationalization you want to avoid directional words like 'left', 'right', 'top', and 'bottom'.

TIL Using pseudo-classes in your querySelector!

let notTuna = document.querySelectorAll('.sandwich:not(.tuna)')