
#Css inherit font family android
The user's browser will be able to match an available font to the generic family that you specify.įor example, if you specify sans-serif, a Mac browser might use Helvetica, Windows might use Arial, and Android might use Roboto. Most fonts fit clearly into one of these categories.
:max_bytes(150000):strip_icc()/font-family-html-examples-5bd89484c9e77c0051b09806.png)
These are the keywords that represent five different generic font families. The following generic font-families are defined: Some examples might include Helvetica, Arial, 'Open Sans', Garamond, Raleway, etc. inherit, initial, and unset).įont-family: # Possible Values family-name This is the name of the font family of choice. And, although the current specification doesn't explicitly state it, it makes sense to quote any font names that match any of the CSS-wide keywords (i.e. The same applies if using a font with a name of initial or default. 'fantasy') in order to prevent confusion with the keyword of the same name. For example, if a font is called fantasy, you should quote it (i.e. However, you should always use quotes on font names that happen to have the same name as a generic font. You can also use quotes on font names that don't have spaces (for example, 'Helvetica'), but again, this is optional. While this is not an absolute requiirement, it can help ensure that there are no mistakes in escaping, and the correct font is used. If a font name contains white space, digits, or punctuation characters (other than hyphens), it's recommended that you surround it with single or double quotes (for example, "Times New Roman" or 'Times New Roman'). If none are available, it will use the default browser font.

When using the font-family property, the user's browser will display the text using the first available font that you specify. The CSS font-family property allows you to specify a prioritized list of font family names (for example, Times or Arial) and/or generic family names (for example, serif or sans-serif).
