2011-11-01 144 views
0

我一直使用Dreamweaver中的css來設計我的站點項目。css字體屬性不起作用

到目前爲止,我設法設計了字體大小,顏色,對齊方式,但是在Dreamweaver的設計視圖中,儘管如此,在瀏覽器中它始終顯示時間新的romam,但這並不是我想要的。所有其他屬性看起來不錯... 當我的樣式表是:

font-family:verdana; < 但它的工作原理,當我將其添加在:

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

任何幫助嗎? 謝謝...

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--> 

這仍然顯示Times New Roman字體...

回答

0

有可能是另一種字體標記,覆蓋原來的FONT-FAMILY標籤。

你把那個font-family:標籤放在哪裏?如果您希望它在整個文檔中處於活動狀態,請將其附加到正文或包含整個頁面的某個容器。

如果您仍然無法弄清楚,請粘貼您的代碼。

+0

我已經將font-family屬性放入#div id和.class文件中,但不能用於任何... – user985419

+0

你有多個CSS文件嗎? – jgallant

+0

只是一個... – user985419

2

'語法錯誤?

1.It應該像<div style="font-family:'verdana'">

2.Try這

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

3.如果還是老樣子不起作用。嘗試

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

4.Also與Firebug檢查什麼樣式應用到元素

0

font-family而不是font在你的CSS這樣的:

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

是的,我試過,但仍然沒有工作。 – user985419

+0

感謝你們所有人......我有點努力了......乾杯 – user985419

0

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

,因爲字體大小和字體系列值是必需的。 我建議您在w3.org上閱讀更多關於font property的信息

0

這裏的問題在於您使用font:屬性的方式不正確。

的正確的使用方法是:

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

Check this JSFiddle,我已經把你的那說明目前的實現。