Jump to content

Can't target headings with custom fonts

Recommended Posts

Hi,

I've decided to update my site with custom fonts, but the fonts don't work on headings only <p>, and then I read the York template has "no <h> tag". Great!

I've implemented it on another template just to make sure my fonts work correctly and they do. So any ideas on how I get around this using York or should I just cut my losses and change to a template that has H tags?

Link to comment
  • Replies 6
  • Views 561
  • Created
  • Last Reply
10 minutes ago, olipowell said:

Hi,

I've decided to update my site with custom fonts, but the fonts don't work on headings only <p>, and then I read the York template has "no <h> tag". Great!

I've implemented it on another template just to make sure my fonts work correctly and they do. So any ideas on how I get around this using York or should I just cut my losses and change to a template that has H tags?

h * {font-family: font name;}

eg

h1 * {font-family: font name;}

h2 * {font-family: font name;}

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
15 hours ago, tuanphan said:

h * {font-family: font name;}

eg

h1 * {font-family: font name;}

h2 * {font-family: font name;}

 

Thanks! But that didn't seem to work. Here's my code

 

body {-webkit-font-smoothing: antialiased !important;}

h1 * {font-family: TTFirsNeue-DemiBold;}

@font-face {   
font-family: 'TTFirsNeue-DemiBold';   
src:
url(https://static1.squarespace.com/static/574234079f7266bf7c216219/t/5defc261a4abea7e73c1c086/1575993957527/TTFirsNeue-DemiBold.ttf),
url(https://static1.squarespace.com/static/574234079f7266bf7c216219/t/5defc26d0b22ef461c186eb8/1575993967915/TTFirsNeue-DemiBold.woff),
url(https://static1.squarespace.com/static/574234079f7266bf7c216219/t/5defc276bdfdf024df398b3c/1575993975215/TTFirsNeue-DemiBold.woff2);
}

 

Link to comment
9 minutes ago, olipowell said:

use

h1 {
    font-family: 'TTFirsNeue-DemiBold' !important;
}

or

h1 {
    font-family: 'TTFirsNeue-Regular' !important;
}

Font in h1 and font in font-face need to be same, include ' and '

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Great! That's working.

Out of interest, how would I go about targeting other elements other than the headings. I.e. Site Navigation or Page Descriptions?

Also, not sure if you can help on this one, but on a mobile (not Desktop in mobile mode) the letter spacing of the Headings is noticeably different for some reason.

browser.png

iphone.jpg

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.