2009-11-06 71 views
0

我有一個簡單的網站(主要是靜態HTML/CSS),但由於某些原因,某些網頁不會在Firefox中應用外部CSS(適用於IE)。爲什麼我的網頁不能應用它的CSS?

http://bjmarine.net/services.html - 壞

http://bjmarine.net/index.html - 做工精細

我比較這兩個文件,看不出任何區別。我已經在editplus和記事本中嘗試過它們。當我用螢火蟲查看破損的頁面時,我開始在各處看到一些中文字符。不知道如何解決這個問題,或者它是如何發生的。我很擔心這個網站被其他人改變了,或者編輯添加了這些隱藏的字符(我只使用VS2008和editplus)。

我可以在破損的頁面上看到js中的錯誤,但是相同的代碼在工作頁面上不會顯示錯誤。

任何人都可以提供解決方案和發生什麼原因?

感謝 丹尼斯

+3

爲什麼您的CSS文件位於名爲images的文件夾中? – ChaosPandion 2009-11-06 19:58:30

+0

此外,您的網頁有W3C驗證程序鏈接,但HTML頁面和您的CSS都無效。 – 2009-11-06 20:02:06

+1

這些評論都不涉及這個問題。 – rfunduk 2009-11-06 20:05:45

回答

2

退房html文件

指數的編碼是ISO-8859-1和服務UTF-16(這就是爲什麼你看到奇怪的字符)。

在編輯器中打開文件,保存爲並將service.html的編碼更改回iso。

+0

這是所有關於如何保存文件!除此之外,我嘗試了其他一切。 – 2009-11-06 21:10:56

1

services.html似乎是使用UTF-16編碼的,因此Firefox試圖使用相同的編碼來解釋樣式表。

要保證您使用的編碼一致(UTF-8是一個不錯的選擇),並配置您的Web服務器以在HTTP響應標頭中指定該編碼。

+0

在這種情況下,我無法控制websever編碼,也無法看到我在哪個頁面中指定的位置。 – 2009-11-06 20:14:57

+1

如果您至少對HTML文件有控制權,您可以在標記內使用指令更改其編碼。 (您必須另存爲您的文檔以相同的編碼以及) – 2009-11-06 20:27:31

+0

我仔細看了一眼,看到兩個頁面已經有設置,我從此嘗試過utf-8沒有任何運氣..... – 2009-11-06 20:54:19

1

「********************************************」在CSS文件評論可能是問題嘗試刪除。

警告:搜索','或'{'時文件意外結束。由於選擇器錯誤,規則集被忽略。 源文件:http://bjmarine.net/images/bjmarine.css 行:破一個1個

和源文件是根據火狐(查看源代碼)在UTF-16編碼,但擔任ISO-8859-1。

0

您的javascript中存在錯誤:_gat未在...中定義,它看起來像services.html中的第184行。

+0

這是一個谷歌分析的東西。你會發現很多信息.... google;) – blank 2009-11-06 20:10:15

+0

我也看到這個錯誤,現在上面會提到它,但js谷歌跟蹤代碼是完全相同的破碎和工作的蒼蠅!? – 2009-11-06 20:11:19

+0

這有時會發生,因爲ga.js尚未加載。你可能會在$(window).load(function(){} – George 2014-04-03 08:39:32

0

您可能希望確保樣式表的路徑實際上已到達樣式表所在的文件夾。

的完整路徑應該是http://bjmarine.net/images/bjmarine.css

這是您與修正後的路徑整版。

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 

<head> 

<meta name="Description" content="Boats, Power, Sail, Marina, Berths, Malahide, Dublin, Bangor, Cork, Malta" /> 
<meta name="Keywords" content="your, keywords" /> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<meta name="Distribution" content="Global" /> 
<meta name="Author" content="Denis Hoctor - denishoctor&#64;gmail.com" /> 
<meta name="Robots" content="index,follow" /> 

<link rel="stylesheet" href="http://bjmarine.net/images/bjmarine.css" type="text/css" /><link rel="icon" href="/favicon.ico" type="image/x-icon"> 

<title>BJ Marine.net Power/Sail New &amp; Used Boats</title> 


</head> 

<body> 
<!-- wrap starts here --> 
<div id="wrap"> 

    <div id="header"> 

     <div id="logo"><img src="images/BJMarineLogo811x77.jpg" width="811" height="77" alt="BJ Marine Header" class="no-border" /></div>  

     <!-- Menu Tabs --> 
     <ul> 
      <li><a href="index.html"><span>Home</span></a></li> 

      <li><a href="featuredboats.html"><span>FeaturedBoats</span></a></li> 
      <li><a href="newboats.html"><span>NewBoats</span></a></li> 
      <li><a href="brokerage.html"><span>UsedBoats</span></a></li> 
      <li><a href="ouroffices.html"><span>OurOffices</span></a></li> 
      <li><a href="salesteam.html"><span>SalesTeam</span></a></li> 
      <li><a href="sellyourboat.html"><span>SellYourBoat</span></a></li> 

      <li id="current"><a href="services.html"><span>Services</span></a></li> 
      <li><a href="contact.html"><span>Contact</span></a></li> 
     </ul> 

    </div> 

    <!-- content-wrap starts here --> 
    <div id="content-wrap">  

     <div id="header-columns"> 

     <div class="col7"><a href="new/newboatsframe.html#http://www.beneteau.com/" id="img_rollover_beneteau"><span>Beneteau</span></a></div> 
     <div class="col7"><a href="new/newboatsframe.html#http://www.searay.com/" id="img_rollover_searay"><span>Searay</span></a></div> 
     <div class="col7-center"><a href="new/newboatsframe.html#http://www.cranchi.com/" id="img_rollover_cranchi"><span>Cranchi</span></a></div> 
     <div class="col7-center"><a href="new/newboatsframe.html#http://www.ferretti-yachts.com/" id="img_rollover_ferretti"><span>Ferretti</span></a></div> 
      <div class="col7-center"><a href="new/newboatsframe.html#http://www.customline-yacht.com/" id="img_rollover_customline"><span>Customline</span></a></div> 
     <div class="col7-center"><a href="new/newboatsframe.html#http://www.mochicraft.com/" id="img_rollover_mochicraft"><span>Mochi Craft</span></a></div> 

     <div class="col7-center"><a href="new/newboatsframe.html#http://www.searanger.com/" id="img_rollover_searanger"><span>Searanger</span></a></div> 
     </div> 

     <div id="main"> 
      <h1>Services</h1> 

      <p>At our bases in Malahide and Bangor we have the best lifting and boatyard facilities 
      on the east coast, with capacity for 180 boats ashore in safe, secure boatyards.</p> 

      <h3>Parts Department</h3> 

      <div class="staff-columns"> 
       <div> 
        <p>Our parts department can be contacted directly by email at <a href="mailto:parts&#64;bjmarine.net">parts&#64;bjmarine.net</a> or telephone <strong>+353 1 8061560</strong>. We supply a comprehensive range of all spare parts for the boat brands that we sell. We also supply the following –</p> 
        <ul style="padding-left: 60px;"> 
         <li>Raymarine onboard marine electronic instruments</li> 

         <li>Garmin marine equipment</li> 
         <li>C-Map electronic navigation charts</li> 
         <li>Navionics Marine Charts</li> 
         <li>Garmin Bluechart</li> 
         <li>Sparcraft masts, booms and rigging systems</li> 
         <li>Facnor furling systems</li> 

         <li>Quantum Sails, premier sail design and suppliers</li> 
         <li>Volvo, Yanmar and Mercruiser marine engine parts</li> 
         <li>Trailers</li> 
        </ul> 
       </div> 
      </div> 
      <a href="http://www.dmgsailsports.com/"><img src="images/dmglogo.jpg" width="294" height="130" alt="DMG services" class="float-right-noborder" /></a> 

      <br /> 
      <h3>Training</h3> 
      <p>DMG Sailsports is an ISA Training Centre based in Malahide, Co. Dublin, Ireland. Their courses are based on the ISA Powerboat Scheme and ISA Windsurfing Schemes. Personalised private sail coaching is available to those who have their own boats and would like lessons tailored to their specific needs by our highly experienced ISA Instructors. All of our courses are delivered to the highest standards for both professional and recreational clients and are run all year round, 7 days a week.</p> 
      <br /> 
      <h3>Marina Berths</h3> 
      <p>We can facilitate your boating needs in Portugal, Spain, France, Malta and many other Mediterranean destinations Berths and deliveries etc.</p> 
      <br /> 

      <a href="http://www.lombard.ie/lombard/ireland/personal_customers/marine/index.html"><img src="images/lombard.jpg" width="220" height="83" alt="Lombard Marine Finance" class="float-right-noborder" /></a> 
      <h3>Finance</h3> 
      <p>Whatever your boating dream you could realise it quickly and easily with <a href="http://www.lombard.ie/lombard/ireland/personal_customers/marine/index.html">Lombard Marine Finance</a>.</p> 
      <br /><br /> 
      <h3>Weather and tides</h3> 
      <ul class="tidelist"> 

       <li> 
        <a href="http://www.met.ie/forecasts/sea-area.asp">Met Eireann</a> – Sea area Forcast 
        <a href="http://www.met.ie/forecasts/sea-area.asp"><img src="images/met_logo.gif" width="60" height="32" alt="MET Eireann logo" class="float-right-noborder-tides" /></a> 
       </li> 
       <li><a href="http://www.met.ie/latest/buoy.asp">M2 Weather buoy</a> – Approx 20 nautical miles east of Howth Headt</li> 
       <li> 
        <a href="http://www.ireland.com/weather/tides.htm">Irish Daily Tides</a> 

        <a href="http://www.ireland.com/weather/tides.htm"><img src="images/irishtimes_logo.gif" width="175" height="17" alt="Irish Times logo" class="float-right-noborder-tides" /></a> 
       </li> 
       <li> 
        <a href="http://www.windguru.cz/int/index.php?sc=47773">WindGuru</a> 
        <a href="http://www.windguru.cz/int/index.php?sc=47773"><img src="images/windguru_logo.gif" width="175" height="55" alt="Wind Guru logo" class="float-right-noborder-tides" /></a> 
       </li> 
      </ul> 
     </div> 


    <!-- content-wrap ends here -->   
    </div> 

    <div id="footer-wrap"> 
     <div id="footer-columns"> 
      <div class="col3"> 
       <h3>Dublin</h3> 
       <code> 
        Malahide<br /> 

        Dublin, Ireland<br /> 
        Tel:(+353) 1 8061560<br /> 
        <a href="mailto:sales&#64;bjmarine.net">sales&#64;bjmarine.net</a> 
       </code> 
      </div> 

      <div class="col3-center"> 

       <h3>Cork</h3> 
       <code> 
        Co. Cork<br /> 
        Ireland<br /> 
        Tel:(+353) 87 7712224<br /> 
        <a href="mailto:sales&#64;bjmarine.net">sales&#64;bjmarine.net</a> 

       </code> 
      </div> 

      <div class="col3-center"> 
       <h3>Belfast</h3> 
       <code> 
        Bangor Marina<br /> 
        Co. Down, N. Ireland<br /> 

        Tel:(+44) 2891 271434<br /> 
        <a href="mailto:sales&#64;bjmarine.net">sales&#64;bjmarine.net</a> 
       </code> 
      </div> 

      <div class="col3"> 
       <h3>Mediterranean</h3> 

       <code> 

        Grand Harbour Marina<br /> 
        Malta<br /> 
        Tel:(+356) 27019356<br /> 
        <a href="mailto:sales&#64;bjmarine.net">sales&#64;bjmarine.net</a> 
       </code> 

      </div> 
     <!-- footer-columns ends --> 
     </div> 

     <div id="footer-bottom">   

      <p> 
      &copy; 2008 <strong>BJ Marine Ltd.</strong> | 
      Design by: <a href="mailto:denishoctor&#64;gmail.com">Denis Hoctor</a> | 
      Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | 
      <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> 


      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

      <a href="index.html">Home</a>&nbsp;|&nbsp; 
      <a href="contact.html">Contact</a> 
      </p>  

     </div>  

<!-- footer ends--> 
</div> 
<!-- wrap ends here --> 
</div> 

<script type="text/javascript"> 
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); 
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); 
</script> 
<script type="text/javascript"> 
var pageTracker = _gat._getTracker("UA-1206900-2"); 
pageTracker._initData(); 
pageTracker._trackPageview(); 
</script> 

</body> 
</html> 

本身局部有eveything除非您的徽標上來的頁面放置這條道路。

祝你好運,希望這可以幫助你。

+0

)中添加一個延遲或調用_gat,但它並沒有讓我感到厭倦,我已經在本地完成了它,並且沒有任何改變。跟着網址到css – 2009-11-06 20:09:43

0

看起來像你有一些CSS錯誤。

.align-centre 

可能是錯誤的拼寫和選擇屬性不關閉:

} 

我會通過CSS文件中運行,並確保它是有效的。

+0

我通過cleancss.com運行整個文件並且沒有任何影響 – 2009-11-06 20:50:23

+0

嘗試將此添加到頂部 @charset「utf-8」; – Kevin 2009-11-06 20:53:23

+0

並將您的html 不是我即將使用utf-8 – Kevin 2009-11-06 20:57:17

相關問題