joseph
joseph

Reputation: 9

How to change font-family of the headers, like h2?

This problem is kinda weird:

I've added a new font-family and it is being applied to everywhere in theme, except the homepage intro headings.

I added a code manually (selecting the exact class through inspect element).

.h2.text-heading-default{
    font-family: "tahome";
}

And I expect it should solve the problem but the headings are still showing the previous fonts.

What is the solution for this?

Stuff that I tried:

Still nothing worked.

Upvotes: 1

Views: 11115

Answers (4)

Mahdi
Mahdi

Reputation: 11

Perhaps the header has a "!important" tag in the font-family css. If so, you can remove the "!important" word in the header css or add "!important" to your class.

Upvotes: 0

user15338987
user15338987

Reputation:

<!DOCTYPE html>
<html>
<head>
<style>
h2.textstyle {
    font-family: tahoma
}
</style>
</head>
<body>
<h1>This is a Heading</h1>
<h2 class = "textstyle">Changing text style to tahoma</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

Could there perhaps be an error in the name of the text style with it being called 'tahome' because I tried, that it didn't work, but when I did the above code in html, for 'tahoma' it worked.

Upvotes: 2

Tanju Karakaya
Tanju Karakaya

Reputation: 1

.h2.text-heading-default {
  font-family: 'tahome' !important;
}

Just add '!important' in front of font-family name.

Upvotes: 0

Soham Grover
Soham Grover

Reputation: 121

Many People have already answered, but let me tell you again that you need to add !important to it. If this doesn't work, then try simplifying the code.

.h2 /* Try writing this only*/ {
font-family: "tahome" !important;

}

Also check if there are any mistakes in HTML code. You can post the HTML code in Stackoverflow for re-checking.

And yes, I'm not really sure but if this isn't working, it may be possible that the font-family you installed doesn't support the headings. Try downloading another font=family.

Bye. Have a great day!

Upvotes: 0

Related Questions