Hey, this may be a complete noob question. I’ve gotten pretty good at CSS, but this is a bit confusing. Lets say the site settings set H2 to a font like Finger Painting, but then you want to change an H2 somewhere else to lets say Bad Script.
How would I go about that in CSS? I’ve tried using the font-family command, but it has 3 different categories, I’m not sure how it all works.
Thank you so much!
Hey Dzimnikov,
Thank you for the inquiry.
What do you mean by categories? You can apply a unique class name (e.g., av-google-bad-script) to the h2 element either by defining the attribute manually or by using the Advanced > Developer Settings > Custom CSS Class field if you’re using a Special Element.
.responsive #top .av-google-bad-script {
font-family: 'Bad Script', cursive;
}
However, before that, you need to manually load the font:
function ava_enqueue_google_fonts() {
wp_enqueue_style( 'av-google-font-bad-script', 'https://fonts.googleapis.com/css2?family=Bad+Script&display=swap', false );
}
add_action( 'wp_enqueue_scripts', 'ava_enqueue_google_fonts' );
Best regards,
Ismael