# How to centre layered fonts?

**URL:** https://forum.pinegrow.com/t/how-to-centre-layered-fonts/9934
**Category:** Styling (CSS)
**Created:** [October 21, 2024, 5:14pm UTC](https://forum.pinegrow.com/t/how-to-centre-layered-fonts/9934 "2024-10-21T17:14:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ragandbone](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@ragandbone](https://forum.pinegrow.com/u/ragandbone)
#### Post date: [October 21, 2024, 5:14pm UTC](https://forum.pinegrow.com/t/how-to-centre-layered-fonts/9934/1 "2024-10-21T17:14:31Z")

</div>

I’m trying to use a layered font using CSS “:after” on a class to load the shadow version of the font. The css for the font uses weight to call the different font layers.

Everything works as expected until I try to centre the text, and then the layers don’t align. Any tips, alternate approaches?

My test page is here:  
[https://www.ragandbone.ca/plain-layer.html](https://www.ragandbone.ca/plain-layer.html)

The code for the page:

Layer test .shade{ position: relative; font-size: 8em; font-family: 'Besley Shaded Web'; color: #595774; font-weight: 400; } .shade:after{ position: absolute; top: 0; left:0; content:"Story Time"; color: #F2B035; font-weight: 500; } .shade2{ position: relative; text-align: center; font-size: 8em; font-family: 'Besley Shaded Web'; color: #595774; font-weight: 400; } .shade2:after{ position: absolute; top: 0; left: 0; content:"Story Time"; color: #F2B035; font-weight: 500; }
# Left align layers as hoped,

Center align not at all!

Story Time

Story Time

---

<div class="post-metadata">

### Author: ![PeteSharp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/petesharp/32/7073_2.png) [@PeteSharp](https://forum.pinegrow.com/u/PeteSharp)
#### Post date: [October 22, 2024, 7:32am UTC](https://forum.pinegrow.com/t/how-to-centre-layered-fonts/9934/3 "2024-10-22T07:32:44Z")

</div>

Try adding width: 100% to .shade2:after

---

<div class="post-metadata">

### Author: ![ragandbone](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@ragandbone](https://forum.pinegrow.com/u/ragandbone)
#### Post date: [October 22, 2024, 10:19am UTC](https://forum.pinegrow.com/t/how-to-centre-layered-fonts/9934/4 "2024-10-22T10:19:49Z")

</div>

Well! That seems to work perfectly. Why didn’t I think of that?—Because I have no idea what I’m doing 🙂

Thanks so much for your help.
