How doesn't the font-family work here?

9.2k Views Asked by At

I tried this:

div.content
{
    font-family: Verdana;
}

and this:

div.content
{
    font-family: 'Verdana';
}

and this:

#view
{
 /* other stuff */
 font-family: Verdana;
}

for this simple html:

<div id="view">
  asdas AHGAUHGAS
  <!-- some other stuff -->
</div>

And it doesn't work...

I also tried with like 15 different fonts (in case some of them are not available in my IDE or whatever)... still no effect.

UPDATE: jsfiddle for the ones who want it

4

There are 4 best solutions below

2
On BEST ANSWER

Try font-family: Verdana, sans-serif; see how that works.

Also post a JSfiddle so people here can have a play about with your code.

0
On

You don't have a div.content in your HTML there so that won't do anything.

Check you actually have the Verdana font installed on your computer then try this:

#view { font-family: 'Verdana' !important; }

Also, slightly unrelated but you're using CSS comment tags in HTML.

1
On

First u have "Verdana" font family in your PC. Check your system.

0
On

Don't know where is the error:

<style type="text/css">
    #view{font-family:"Verdana", Geneva, sans-serif;} 
    #view{font-family:"Verdana";}
    #view{font-family:Verdana;}
</style>

You can use any one CSS to show the Font-Family.