'CSS font-family for label not working

i have the below simple code

test content

and

css code

label{ font-family: "Andale Mono"

}

whatever font we added font style is not changing for the label content , any suggestion please.



Solution 1:[1]

Try?

<font face="Andale Mono" color="Black">

Also did you include a link to Andale Mono in the tag?

Solution 2:[2]

Use it or try to apply using ID/CLASS

label
{
font-family:"Andale Mono",Georgia,Serif;
}

Hope it will work.

Solution 3:[3]

I find that, Andale Mono is not a google font. So, in that case, you have to manually add the font to your project using @font-face. See this for reference: https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp .

And another thing.. for changing the font for a label element, you have to follow the main syntax of font-family. Suppose:

label {
font-family: 'Roboto', sans-serif;  // A google font
}

Here, 'Roboto' is A font family name and 'sans-serif' is a generic family name. You have to put both, a family name and a generic family name. It worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 seek.estate
Solution 2
Solution 3