I have noticed that in case of <button>
tags, font-family is not inherited automatically; either I must specify it explicitly like:
<button style="font-family: some_style;">Button</button>
or use inherit property like this:
<button style="font-family: inherit;">Button</button>
However, the font-family is automatically inherited in case of other tags, the <a>
tag for example.
Why do we have this issue with the <button>
tags?
Here's a DEMO.
Buttons have their own font-family, so don't inherit from the cascade unless you tell it to.
Using CSS Reset, or specifically font: inherit means that on browsers supporting the inherit value, all such elements are rendered in copy text font, unless otherwise specified in a style sheet. So this is about a particular methodology (or, as some people might say, ideology or religion) of authoring and design.
There are two types of font family names: family-name - The name of a font-family, like "times", "courier", "arial", etc. generic-family - The name of a generic-family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".
Font Type: Font type can be set by using face attribute with font tag in HTML document.
Form elements don't inherit font settings, you have to set these properties manually.
If you use font declaration for eg. body,
body {font-family: arial, sans-serif}
use just
body, input, textarea, button {font-family: arial, sans-serif}
or
input, textarea, button {font-family: inherit}
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