2014-04-20 48 views
1

我在兩個不同的HTML頁面上使用相同的css文件來實現同樣的功能,在主頁上字體看起來粗體,但在另一頁上我看到一些字體大小變化。什麼導致應用於2個不同html文件的相同css字體樣式顯示不同?

這是它在瀏覽器中的顯示方式。

enter image description here

有一個在頁面的字體重量差。

CSS代碼

.nav a { 
text-transform: uppercase; 
text-decoration: none; 
color: #0083b7; 
text-transform: uppercase; 
font-weight: 800; 
border-bottom: 1px solid #0083b7; 
font-size: 13px; 

我不知道爲什麼會出現這種情況,請告訴我如何糾正它。

謝謝。

+0

請閱讀[我的網站上不起作用的東西。我可以只粘貼一個鏈接嗎?](http://meta.stackexchange.com/questions/125997/something-on-my-web-site-doesnt-work-can-i-just-paste-a-link -to-IT)。當外部資源消失或者固定時,依賴於外部資源被理解的問題變得毫無用處。改爲創建一個[SSCCE](http://www.sscce.org/)。 – Quentin

回答

2

你唯一的問題是在profile.css中你的自定義字體由於某種原因沒有被正確加載。事實上,如果您嘗試使用Chrome檢查器將相同的字體放到這兩個頁面上,您會發現它們幾乎相同。

在profile.css你看到的不是Merriweather sans,而只是無襯線。試着找出原因。

編輯,這裏的原因: 在你的個人資料頁你錯過

<link href="http://fonts.googleapis.com/css?family=Merriweather+Sans:400,300,300italic,400italic,700,700italic,800,800italic" rel="stylesheet" type="text/css"> 
在HEAD

..(HTML),你必須是你第頁。把字體加載到你的個人資料頁面,你很好去。

這裏的結果:

http://i.imgur.com/fb0hWA5.png

+0

非常感謝你解決了我的頭痛問題。這對我很有幫助。 – SPGuar

+0

@S_PRATAP如果Andrew的答案已解決您的問題,請接受它作爲答案(綠色勾號)。 – pwdst

0

看起來你在「健身房」頁面的身體標記內有一些奇怪的重複代碼。

<body promptdialogcheckdone="1"><embed id="__IDM__" type="application/x-idm-downloader" width="1" height="1" style="visibility: hidden !important; display: block !important; width: 1px !important; height: 1px !important; border-style: none !important; position: absolute !important; top: 0px !important; left: 0px !important;"> 


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 

<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<title>Dear Fitness</title> 

<link href="images/css" rel="stylesheet" type="text/css"> 
<link href="images/css(1)" rel="stylesheet" type="text/css"> 

<link href="/test1/css/profile.css" rel="stylesheet" type="text/css"><link href="/test1/css/common.css" rel="stylesheet" type="text/css"><link href="/test1/css/responsive.css" rel="stylesheet" type="text/css"> 
<!---Footer ---> 
    /* snipped for space */ 

<!---Footer ---> 

<div class="green_border"></div> 
+0

我無法理解,請描述一下。我犯了什麼錯誤? – SPGuar

相關問題