- This topic has 7 replies, 2 voices, and was last updated 5 months, 2 weeks ago by
Elvin.
-
AuthorPosts
-
September 14, 2020 at 9:43 am #1442889
DM
Hi there!
I need to create a custom class ‘tgch1’ in my child theme css like H1, H2, H3 that will apply specific formatting to the custom class. I think that I am overthinking it. I have imported my Adobe fonts using a hook in the GP Elements. I added this to the child css:
@font-face {
font-family: ‘tgch1’, clarendon-urw, serif;
font-weight: 600;
font-size: 72px;
}September 14, 2020 at 12:43 pm #1443128Elvin
StaffCustomer SupportHi,
@font-face {
font-family: ‘tgch1’, clarendon-urw, serif;
font-weight: 600;
font-size: 72px;
}@font-face
needs asrc: url(url link to font);
to work but I believe you don’t have to add this CSS anymore.Assuming you’ve done the proper steps on importing Adobe Typekit/fonts to WordPress, you won’t have to
@font-face
importing of fonts as the embed code provided by will do that for you.I’ve checked your site and found this linked css. This css file is already importing clarendon-urw.
You can read its contents here.
https://use.typekit.net/rbc4ibz.cssSince your site is already loading a CSS that imports the typekit fonts, you can try creating custom classes by doing something like this:
.tgch1 { font-family: "clarendon-urw",serif; font-weight: 600; font-size: 72px; }
Let us know if it works for you.:)
A wise man once said:
"Have you cleared your cache?"September 14, 2020 at 1:17 pm #1443171DM
I tried add this code to the child theme css file and it did not work. Unless I am calling it wrong. I used <tgch1>Sample Title</tgch1>
September 14, 2020 at 1:24 pm #1443188DM
I got it! just took the dot off!
tgch1 {
font-family: “clarendon-urw”,serif;
font-weight: 600;
font-size: 72px;
}September 14, 2020 at 1:32 pm #1443199Elvin
StaffCustomer SupportI tried add this code to the child theme css file and it did not work. Unless I am calling it wrong. I used <tgch1>Sample Title</tgch1>
You use css classes by doing something like this:
<h1 class="tgch1">Sample Title</h1>
I see that you’re using custom HTML tags rather than CSS classes.
If you want to do CSS w/ custom HTML tags like (
<tgch1>
) instead of classes (<h1 class="tgch1">
), you can do something like this.tgch1 { font-family: "clarendon-urw",serif; font-weight: 600; font-size: 72px; }
A wise man once said:
"Have you cleared your cache?"September 14, 2020 at 1:34 pm #1443202Elvin
StaffCustomer SupportI got it! just took the dot off!
tgch1 {
font-family: “clarendon-urw”,serif;
font-weight: 600;
font-size: 72px;
}Nice one. Good to know.
Feel free to open new topics if you have any other questions that needs addressing.
Cheers.
A wise man once said:
"Have you cleared your cache?"September 14, 2020 at 1:38 pm #1443207DM
Thanks! 🙂
September 14, 2020 at 1:45 pm #1443213Elvin
StaffCustomer SupportAwesome, no problem. 🙂
A wise man once said:
"Have you cleared your cache?" -
AuthorPosts
- You must be logged in to reply to this topic.