Happening now | Shopify Community AMA: SEO Basics with 2H Media | Ask your questions now!

Change font header

Change font header

INFRA
Shopify Partner
238 2 84

Hi there,

 

I would like to change the font of the header  in this section. I've tried below code but it's not working. Is there something else I could try? I've applied this font successfully to other sections on my site.

.image-text-heading-heading_89gPr6 {
  font-family: "Spectral-semibold", serif;
  font-size: 12px;
}

 and this one did not work either

.h2 {
font-family: "Spectral-semibold", serif;
font-size: 12px;
}

 

Screenshot 2024-10-21 at 17.29.21.png

website

Password: fbc

 

Thanks so much!

Replies 5 (5)

Moeed
Shopify Partner
7370 1995 2436

Hey @INFRA 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
.image-text-heading-heading_89gPr6 * {
    font-family: "Spectral-semibold", serif !important;
    font-size: 30px !important;
}
</style>

RESULT:

Moeed_0-1729493122808.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


INFRA
Shopify Partner
238 2 84

hi! I applied the code with the * and it worked, now I am trying to get it on a section below 

Screenshot 2024-10-21 at 19.44.10.png

 

this one is not giving me any results:

.feature-heading-template--17337916227677__ss_feature_19_NRcfd6 * {
    font-family: "Spectral-MEDIUM", serif !important;
  
}

 

Appreciate your help 🙂

rajweb
Shopify Partner
785 66 142

 

<style>
  .image-text-heading-heading_89gPr6 {
    font-family: "Spectral-semibold", serif !important;
    font-size: 12px !important;
  }
</style>

 

If the CSS isn't applying, try adding the styles inline in the section for debugging purposes:

 

<h2 class="image-text-heading-heading_89gPr6" style="font-family: 'Spectral-semibold', serif; font-size: 12px;">
  Header Text
</h2>

 

This ensures the style applies directly to see if it works.

If these steps don't work, let me know

Hey @INFRA ,

Check for Specificity Issues:

The CSS might not be specific enough, and other styles could override it. Try increasing the specificity like this:

 

.image-text-heading-heading_89gPr6.h2 {
  font-family: "Spectral-semibold", serif !important;
  font-size: 12px !important;
}

 

The !important ensures your styles override any others.

 

2. Confirm the Correct Class Names

Ensure that the class .image-text-heading_89gpr6  or .h2 is correctly applied to the HTML element you're targeting.

Inspect the element using Developer Tools(right-click -> Inspect) to verify the class name. If Shopify has dynamically generated or changed it, adjust accordingly.

Load the Font Correctly:

Make sure  "Spectural-semiboldis loaded on your site. If it's a Google font, you can add it to your theme using:

 

<link href="https://fonts.googleapis.com/css2?family=Spectral:wght@600&display=swap" rel="stylesheet">

 

Or if it's declared in the theme.liquid  or CSS file, verify its correct loading.

 

Add CSS to the Correct File or Location:

Sometimes Shopify themes have multiple CSS files. Try adding the CSS in your theme.liquid file or the custom CSS section:

 

 

 

 

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev

ZestardTech
Shopify Partner
6134 1097 1473

Hello @INFRA 

 

1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset > base.css and paste this at the bottom of the file:

 

.image-text-heading-heading_89gPr6 h2 {
font-family: "Spectral-semibold", serif!important;
font-size: 12px!important;
}
Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing

Dan-From-Ryviu
Shopify Partner
11612 2276 2456

Please add this to Custom CSS of that section instead 

h2 {
font-family: "Spectral-semibold", serif;
font-size: 36px;
}

Screenshot 2024-10-21 at 14.05.39.png

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.