I want all headings and everything in them, such as anchor tags, to be a certain font family. This works:
h1, h2, h3, h4, h5, h6, h1 > *, h2 > *, h3 > *, h4 > *, h5 > *, h6 > * {
font-family: serif;
}
I was wondering if this is the most efficient way to do it?
font-family is inherited, so it you're not overriding it elsewhere, you can simply do this which will work for the child elements too:
h1, h2, h3, h4, h5, h6 {font-family:serif;}
If you are overriding it elsewhere, then it depends how exactly you're overriding it to know what specificity you need here.
If you would like to apply it to all texts (paragraph or headers), you could use
* {font-family: sans-serif}
in your CSS file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With