![](/img/trans.png)
[英]Why is my PHP/HTML Header color/border not showing in OLD IE Browsers/ And it's not the CSS
[英]HTML/CSS IE not showing header
我的新网站具有内置在标题图像中并与标题图像重叠的导航。 可悲的是,在Internet Explorer(所有版本<10)中,我的标题和导航都消失了 。 用经典的逐行HTML编程的所有程序似乎都可以正常工作。 我已经尝试了文档类型的修复程序,但无济于事。
我试图弄乱我目前的数字,什么也没有。
这是标头的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>
什么是
Header
{...}
究竟? 如果您使用的是<header>
标签,则将其删除,然后将css标头{}替换为div.header {},并将其应用于div标签,例如<div class='header'>...</div>
也#00; 应该是#000; (三种颜色,而不是2种颜色,因为这可能会在不同的浏览器中给您带来有趣的结果)。
您可能还想使用具有position:relative;的容器元素。 进行设置只是为了帮助浏览器确定从何处开始定位。
您可以发布CSS附带的html的有效代码段吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.