Jump to content

Change the font on an individual page with custom code

Go to solution Solved by CassAggett,

Recommended Posts

Posted

Site URL: https://www.janedoenomore.org/

I would like to add the Adobe font 'Relation' to certain key words/phrases on our website. 

I added the font 'relation.otf' to Custom CSS (screenshot below)

image.thumb.png.9ba2ef6dabc08f29858aa7c5f0fac1d1.png

Adobe provided the code below:

font-family: relation-two, sans-serif;
font-weight: 400;
font-style: normal;

'Survivor-led Programs' pictured below is an image on the homepage. I would like to make it html and use it only occasionally throughout the site.

image.thumb.png.7451d6256921a3a98a85793af753aac7.png 

Thank you in advance.

image.png

  • Solution
Posted

@DonnaP Are there specific font sizes you would like to use this font for? E.g. H1, all heading fonts (on certain pages), etc? I can give you the right code to target just those.

Because you're using Adobe's code, there's no need to upload the OTF file. Just make sure you've added the stylesheet to your site's Header Code Injection field before adding the CSS code.

Then for your headings, here's an example of making all headings, that are italicised, the new font (assuming you don't already use italics in your headings):

// ITALIC HEADINGS
h1 em, h2 em, h3 em, h4 em {
  font-family: relation-two, sans-serif !important;
  font-weight: 400;
  font-style: normal;
}

That way any time you add a new heading and make it italic, it will show the new font

Instruction: How to set a site-wide password

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

 

Posted

I ran into an issue when I changed the type in the footer to the Relation font.

This screenshot shows the logo at the top and the type properly, The blue box on the left is a code block for constant constant sign up.

image.thumb.png.acc40625a7764cfb411a2aa7d60a278f.png

Below is how the footer appears once I save it. There is a huge gap of space between the logo and the words Empowering Survivors which is in the Relation font.

image.thumb.png.7415a1c5aebfcca7a2ae2189b1eb1468.png

It appears fine on mobile. Help is greatly appreciated. Thank you in advance.

Posted
1 hour ago, DonnaP said:

I ran into an issue when I changed the type in the footer to the Relation font.

This screenshot shows the logo at the top and the type properly, The blue box on the left is a code block for constant constant sign up.

image.thumb.png.acc40625a7764cfb411a2aa7d60a278f.png

Below is how the footer appears once I save it. There is a huge gap of space between the logo and the words Empowering Survivors which is in the Relation font.

image.thumb.png.7415a1c5aebfcca7a2ae2189b1eb1468.png

It appears fine on mobile. Help is greatly appreciated. Thank you in advance.

It looks to be a glitch with the email sign up code block - as you can see below with the browser inspect tool, the row you've got the code block in has stretched to fit it, rather than taking up multiple rows:

image.thumb.png.e02d9ddafd19e859cb663bc4e939d5fb.png

I don't think it's related to the font change, likely just coincidental timing.

In saying that, when you're in edit mode, try make the code block as long as it should be on the live site - maybe 6 or 7 rows - you can use the Contact Us text on the other side for reference. Theoretically it should then span the correct amount of rows and everything else will stay in place 😊

 

Instruction: How to set a site-wide password

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

 

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.