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

Google font upload via custom CSS


londonumlungu

Question

  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

5 answers to this question

Recommended Posts

  • 0

Hi,
Please share your website URL.
But use this code.

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

h1{font-family: 'Roboto', sans-serif !important;}

Please use the like button if it helps you!

Best,
Leopold

Ninja Kit Extension: Upgrade your Squarespace website without coding.

YouTube Preview    -    FREE DOWNLOAD

Link to post
  • 0

Hi Leopold

Thanks for the help! The site is:  http://lckdn20.com/ 

Unfortuantely that code didn't work. I;ve pasted a screenshot below.

image.png.a4410393880ee04ff6c2fd2d2c0f2445.png

Can I just ask, wouldn't there need to be a middle line of code between @import and h1, which would be: @font-face{font-family: 'Roboto', sans-serif;}  ?

I tried that out of curiosity, and that didn't work either, screenshot below.

image.png.a27abcd7dfd95c903183b7fd3a41a051.png

 

Thanks
Dave

 

 

 

Link to post
  • 0

You can add to Home > Settings > Advanced > Code Injection > Header

<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">

then add to Home > Design > Custom CSS

h1 {
	font-family: 'Roboto', sans-serif;
}

 

You can send your question to my email to get faster answer. / How to Setup Password & Share URL 

-- I'm Tuan, work for a non-profit project (build free libraries). I check the forum once or twice a day to help out the community. If you don't see me answering your question, you can send it to the email above. 

Link to post
  • 0
On 8/27/2020 at 5:14 PM, londonumlungu said:

Can anyone pls tell me what is wrong with this code when trying to upload a Google font via custom CSS.

I'm not clear why you are trying to add the Roboto font with code. Many Google Fonts are built into Squarespace and can be used without requiring code:

roboto-font.thumb.png.4231c456f22e053864d568634504afd5.png

 

 If this helps you, please click "Like" below  ⬇️

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digital, a specialist company helping Squarespace users by building the features that Squarespace didn't include.
Explore our range of Squarespace Extensions, including the Wishlist, and Datepicker Extension or book a Squarespace Expert for 1:1 help. Note that links in my posts may be affiliate links.

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