Jump to content

CSS code to change letter spacing for uppercase H1 and H2 sitewide

Recommended Posts

Posted

I have the following code added to my website to increase spacing between H1 and H2 header letters from the 0 em set in site styles:

h1, h2{
  letter-spacing: 0.14em !important;
}

This is because H1 and H2 are used in uppercase across my site, so for styling bigger spacing looks best. But, I now want to use H1 and H2 in my blog posts in lowercase and I need the spacing  to be 0 when in lowercase.  Is it possible to alter the coding so the increased letter spacing of 1.4 em only applies when the title is written in uppercase? 

Many thanks

Posted

My site isn't published yet so I can't share but I've attached a screenshot . The code has been applied to all the headers in uppercase across the site. This example is 'THE BLOG'. There are about 10 places across the site in total that need the increased space when written as an uppercase heading. The rest of the uses for H1 and H2 are in lowercase and require 0 spacing. Site styles is set at 0 spacing for H1 and H2.

Screenshot 2023-12-29 at 15.39.54.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.