Basically, I need to adjust the font type everywhere it isn't specified. How can I do that? table
, div
, span
, p
, input
, you name it. Is there a way I can do them all with 1 CSS rule that I can add?
Yes there is, use it on the body element and it will cascade down to all children unless you specify otherwise.
body {
font-family: Arial, Verdana, sans-serif;
}
#tahoma {
font-family: Tahoma, sans-serif;
}
You can then override it
<body>
<div id="default">
I will inherit the body font-family, in this case Arial because no other rule has been set!
</div>
<div id="tahoma">
<p>Me, <span>Me</span> and <strong>Me</strong> are using Tahoma because our parent #tahoma says so.</p>
</div>
</body>
This is why it's called Cascading Style Sheets. Styles set at any level will "cascade" down. So if you set this styling on the body
element, every other element in the body
will take on the same styles.
body {
font: ...;
}
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