2012-11-29 83 views
0

我的新網站功能內置到導航和重疊標題圖片。可悲的是,在Internet Explorer(所有版本< 10),無論我的頭和導航只是。所有使用經典的逐行HTML編程的東西似乎都能正常工作。 我已經嘗試過文檔類型的修復程序,無濟於事。
我試着搞亂我現在的數字,什麼都沒有。HTML/CSS IE無法顯示標題

這是爲標題中的CSS:(PHP選擇隨機圖像)

Header 
    { 
     height: 128px; 
     background: url(<?php echo $selectedBg ?>); 
     text-indent: -9999px; 
     border-bottom: 0px solid #00; 
     padding: 0px; 
     margin: 0; 
    } 

而對於導航:(簡單使用這個類的內部)

div.navigation 
{ 
    position: absolute; 
    top: 81px; left: 425px; 
    height: 47px; width:575px; 
    background-color: transparent; 
    z-index: 10; 
    padding: 0px; 
    margin: 0; 
    margin-left: 15px; 
} 

公告CSS:

div.announcement{ 
    position: absolute; 
    top: 140px; left: 425px; 
    height: 47px; width:575px; 
    z-index: 20; 
} 

所有我需要做的是正確地做這個節目在所有瀏覽器。感謝任何能夠幫助的人。

請求的代碼片段:

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 

<?php 
    $bg = array('images/header1.png', 'images/header2.png', 'images/header3.png', 'images/header4.png', 'images/header5.png', 'images/header6.png', 'images/header7.png', 'images/header8.png'); // array of filenames 

    $i = rand(0, count($bg)-1); // generate random number size of the array 
    $selectedBg = $bg[$i]; // set variable equal to which random filename was chosen 
?> 

<html lang="en"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>BitFracture.com</title> 
    <link rel="icon" href="images/site.ico" type="image/x-icon"> 
    <link rel="shortcut icon" href="images/site.ico" type="image/x-icon"> 
    <link rel="stylesheet" type="text/css" href="style.css" media="screen,projection"> 
    <link href="*" rel="stylesheet" type="text/css"> 
    <style type="text/css"> 
    Header { 
     height: 128px; 
     background: url(<?php echo $selectedBg ?>); 
     text-indent: -9999px; 
     border-bottom: 0px solid #00; 
     padding: 0px; 
     margin: 0; 
     } 
    </style> 
</head> 

<body> 
<div id="container" class="clearfix"> 
<div class="navigation"> 
    <a href="#"><img src="images/home.png" onmouseover="this.src='images/homeh.png'" onmouseout="this.src='images/home.png'"></a> 
    <a href="#"><img src="images/repairs.png" onmouseover="this.src='images/repairsh.png'" onmouseout="this.src='images/repairs.png'"></a> 
    <a href="#"><img src="images/articles.png" onmouseover="this.src='images/articlesh.png'" onmouseout="this.src='images/articles.png'"></a> 
    <a href="#"><img src="images/software.png" onmouseover="this.src='images/softwareh.png'" onmouseout="this.src='images/software.png'"></a> 
</div> 
<div class="announcement"> 
    <p> <b>News:</b> Our new site is up and running!</p> 
</div> 
<header></header> 
+0

這可能是因爲您正在使用HTML標記('

'),而IE標記的舊版本無法識別該標記。 –

回答

0

是什麼

Header 
    {...} 

到底是什麼?如果您使用的是<header>標籤,則將其刪除並用div.header {}替換css標頭{},並將其應用於div標籤,如<div class='header'>...</div>

也#00;應該是#000; (三種顏色,而不是2,因爲這可能會讓你在不同的瀏覽器中獲得有趣的結果)。

您可能還需要使用具有位置的容器元素:相對的;設置只是爲了幫助瀏覽器從哪裏開始定位。

你能也許張貼的CSS去與HTML的工作片斷?

+0

謝謝你的幫助。我已將有問題的代碼添加到原始問題中。 –

+0

此外,進行上述更改已從所有瀏覽器中完全刪除標題。我試圖通過在div.header中添加標籤來使其工作。 (更新,即工作!謝謝!) 再多一次問,爲什麼頭略框架之外的顯示? –

+0

非常感謝,不知何故,只有在IE6上有問題,所以大多數不會有這個錯誤。 IE7,8,9和10以及forefox 3-17和chrome都可以工作。 –