Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
olipowell

Can't target headings with custom fonts

Question

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?

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0
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;}

Share this post


Link to post
  • 0
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);
}

 

Share this post


Link to post
  • 0
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 '

Share this post


Link to post
  • 0

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

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...