aboutsummaryrefslogtreecommitdiff
path: root/_posts/2019-05-03-first-letter.md
blob: 8cd34d65026119cfc81146e0aae9c86ce2daa009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
layout: post
title: "First Letter Pseudo Element"
date: 2019-05-03
---


In today's TypeTip we will be taking a look at the often overlooked `:first-letter` CSS pseudo element. Though you might only use this for specific article-format web pages, it's still a nice-to-have in your web dev toolset.

## The HTML

Like most pseudo elements, nothing has to change with your pre-existing HTML structure:


    <article>
        <p>It was a bright cold day in April, and the clocks were striking thirteen.</p>
    </article>


## The CSS

Here's where the magic happens:


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


## Live CodePen

[Live CodePen Example](https://codepen.io/bradleytaunt/pen/gJYbev/)