创建标头css - IE和Chrome的浏览器兼容性问题。

时间:2011-10-18 15:13:21

标签: html css

我想使用这张照片作为我的网站的标题,但我面临与浏览器兼容的问题它看起来不像我想要在IE浏览器看起来没关系,因为我肯定将图片拆分为部分我得到了一个和她的作为图像和第二个div我将它作为背景颜色

这是它在chrome中的样子 http://www.4shared.com/photo/IifrVQyF/chrome.html? 这是它在IE中的样子 http://www.4shared.com/photo/dDi_KlKS/IE_online.html? 这就是我在做的方式

<html>
<head>
<title>Untitled Document</title>

<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
@import"style.css.css";
</style>
</head>

<body bgcolor="#CCCCCC">
  <div id="HeaderLeftDiv"></div>
  <div id="HeaderRightDiv">
        <ul>
            <li class="current_page_item"><a href="index.php">Home</a></li>
            <li><a href="#">Photos</a></li>
            <li><a href="RegistrationForm.php">Register</a></li>
            <li><a href="#">About Us</a></li>
            <li><a href="#">Contact Us</a></li>
        </ul>
  </div>


</body>
</html>

这是css文件

HeaderLeftDiv
{
    border:"1";
    position:absolute;
    top:12px;
    left:19%;
    width:22%;
    height:13%;
    background:url(Images/Img1.png);
}

HeaderRightDiv
{
    position:relative;
    top:36px;
    left:40%;
    width: 40%;
    height: 54px;
    margin-right: 100px;
    border:3px;
    background-color:#000;
}

1 个答案:

答案 0 :(得分:3)

您是否考虑过默认情况下IE在身体上有余量?

body{margin:0}

应该解决你的问题。