user985419
user985419

Reputation: 31

css font property not working

I´ve been styling my site project with css on dreamweaver.

So far I managed to style the font size, color, alignement, but even thought it all looks fine in the design view of dreamweaver, in the browser it keeps displaying times new romam, wich is not what I wanted. All other properties look fine... It doesn't work when on my style sheet is:

font-family: verdana; < but it works when I add it on the:

<div style:"font-family:'verdana'">

Any help? Thanks...

UPDATE

#footer {
    width:900px;
    height:50px;
    background-color:#F60;
    line-height:50px;
}

.footer {
    font:Verdana, Geneva, sans-serif;
    font-size:16px;
    text-decoration:none;
    color:#000;
    margin-left:15px;
}

<div id="footer">
<a class="footer"> Blah Blah Blah</a>
</div><!--footer-->

This is still displaying times new roman...

Upvotes: 0

Views: 3391

Answers (5)

Leonardo Barbosa
Leonardo Barbosa

Reputation: 1396

The problem here is that you are using the font: property the wrong way.

The correct way to use is:

.footer {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 16px;
  text-decoration: none;
  color: #000;
  margin-left: 15px;
}

Check this JSFiddle that I've put together for you that illustrate the current implementation.

Upvotes: 0

Ju-v
Ju-v

Reputation: 362

or

.footer {
    font:16px Verdana, Geneva, sans-serif;
    text-decoration:none;
    color:#000;
    margin-left:15px;
}

because font-size and font-family values are required. I suggest to read more about font property on w3.org

Upvotes: 0

Dev
Dev

Reputation: 791

'Syntax error?

1.It should be like <div style="font-family:'verdana'">

2.Try this

.footer { font-family:'Verdana', Geneva, sans-serif; font-size:16px; text-decoration:none; color:#000; margin-left:15px; }

3.If stil doesn't work. Try

.footer { font-family:'Verdana', Geneva, sans-serif !important; font-size:16px; text-decoration:none; color:#000; margin-left:15px; }

4.Also check with Firebug what styles been applied to element

Upvotes: 3

sandeep
sandeep

Reputation: 92803

write font-family instead of font in your css like this:

.footer {
    font-family:Verdana, Geneva, sans-serif;
    font-size:16px;
    text-decoration:none;
    color:#000;
    margin-left:15px;
}

Upvotes: 0

jgallant
jgallant

Reputation: 11273

There might be another font tag that overrides your original font-family tag.

Where are you putting that font-family: tag? If you want it to be active across your entire document, either attach it to the Body, or some container that encompasses your entire page.

Paste your code if you still can't figure it out.

Upvotes: 0

Related Questions