Jump to content

My Custom Fonts in my Custom CSS Are Not Working?

Go to solution Solved by CassAggett,

Recommended Posts

Hello!

For some reason my custom CSS font is not working on browsers (other than Chrome) and on all mobiles.

I'm only using one custom font, applied to all of the headers and some buttons.

I've double checked the code and it appears to me that there are no mistakes.

I've also tried adding two src: on for each bit of code and that hasn't helped either.

Here is the code I'm using for the entire website:

font-face {
font-family: 'Sinclaire';
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
}h1 {font-family: 'Sinclaire';}
font-face {
font-family: 'Sinclaire';
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
}h2 {font-family: 'Sinclaire';}
font-face {
font-family: 'Sinclaire';
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
}h3 {font-family: 'Sinclaire';}
font-face {
font-family: 'Sinclaire';
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
}h4 {font-family: 'Sinclaire';}
h4 {font-family: 'Sinclaire';     
  font-size:20px;   }
.sqs-block-button-element {
  font-family: 'Sinclaire' !important;
}
.header-nav-item a {
  font-family: 'Sinclaire' !important;
}
time.summary-metadata-item.summary-metadata-item--date {
    font-family: 'Sinclaire' !important;
}
a.summary-title-link {
    font-family: 'Sinclaire' !important;
}
a.summary-read-more-link {
    font-family: 'Sinclaire' !important;
}
.header-title a {
  font-family: 'Sinclaire' !important;
}

 

 

If you can help, I'd really appreciate it!

Thank you!

Sam 🙂

Link to comment
  • Solution

@SamFord Hi Sam, the error causing this is likely the missing @ before font-face, however you've also got a lot of duplicated code in there. I've tidied up for you, give this a go:

// LOAD CUSTOM FONT //
@font-face {
  font-family: 'Sinclaire';
  src: url('https://static1.squarespace.com/static/63e6381a7bda54190b25aa55/t/650024760b79e94d77bb7c36/1694508150296/Sinclaire-Bold.otf');
}

// APPLY CUSTOM FONT //
h1, h2, h3, h4 {
  font-family: 'Sinclaire' !important;
}

h4 {
  font-size:20px;
}

.sqs-block-button-element,
.header-nav-item a,
time.summary-metadata-item.summary-metadata-item--date,
a.summary-title-link,
a.summary-read-more-link,
.header-title a {
  font-family: 'Sinclaire' !important;
}

 

Edited by CassAggett

If this helped you, please like or mark my solution as answer so others can scroll to it quickly 👆

Cass Aggett is a Squarespace website designer for go-getting women – no matter what stage of business.

WEBSITEINSTAGRAM

 

Link to comment
11 hours ago, SamFord said:

Hey Cass,

Thank you so much for your help! I'm very new to CSS stuff so thank you for fixing the problem for me!

It works great now!

Sam 🙂

Glad to hear! 😊

If this helped you, please like or mark my solution as answer so others can scroll to it quickly 👆

Cass Aggett is a Squarespace website designer for go-getting women – no matter what stage of business.

WEBSITEINSTAGRAM

 

Link to comment

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.