html - 奇怪的重复 IE div

标签 html css internet-explorer

这是我发现的一个奇怪的错误,IE8 正在复制我的 div,但只是其中的一部分。

在 IE8 中的外观: alt text

这就是它在 FF 中的样子: alt text

和 HTML:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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

    \/\/\

 <div id="roundbigbox">
    <p id="pro">Produkter</p>

        <div id="titles">

    <div id="thinlinecopy"></div>
    <div id="varekodetext">
     <p>Varekode</p>
    </div>
    <div id="produkttext">
     <p>Produkt</p>
    </div>
    <div id="pristext">
     <p>Pris</p>
    </div>
    <div id="antalltext">
     <p>Antall</p>
    </div>
    <div id="pristotaltext">
     <p>Pris total</p>
    </div>
    <div id="sletttext">
     <p>Slett</p></div>
    <div id="thinline"></div>
    </div>


...content...


    <div class="delete">

   <a id="slett" href="/order/delete/1329?return=" title="Slett"><!--Slett--></a>
            </div>

    </div>

FF 的 CSS:

div #roundbigbox {
    background-image:url(../../upload/EW_p_og_L.png);
    background-position:top center;
    background-repeat:no-repeat;
    padding:5px;
    padding-top:10px;
    padding-bottom:0px;
    width:760px;
    height:1%;
    border-width:1px;
    border-color:#dddddd;
    border-radius:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    z-index:1;
    position:relative;
    overflow:hidden;
    margin:0;
    margin-bottom:10px;
    }

IE 的 CSS:

div #roundbigbox {
    background-image:url(../../upload/EW_p_og_L.png);
    background-position:top center;
    background-repeat:no-repeat;
    padding:5px;
    padding-right:50px;
    padding-top:10px;
    width:760px;
    height:1%;
    border-width:1px;
    border-color:#dddddd;
    z-index:1;
    position:relative;
    overflow:hidden;
    margin:0;
    margin-bottom:10px;
    }

什么会导致如此奇怪的错误?它在 HTML 中不重复。我被难住了!

注意:里面有很多其他的div,一个接一个。

感谢您的回复。

最佳答案

我想说的是:graphicdivine。 (删除最后多余的</div>)另外你应该检查你的CSS:

  • 负填充不存在:P(即使在 IE 中)
  • 您只需使用一个声明即可设置内边距:内边距:右上左下
  • 边框和背景相同:

    背景:url(../../upload/EW_p_og_L.png) 顶部中心无重复; 边框:1px实线#ddd;/* 当你有 6 个相同字符的 e 十六进制颜色时,只需写其中 3 个 */

关于html - 奇怪的重复 IE div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2698537/

相关文章:

html - 溢出中断内联显示

javascript - JQUERY 向导步骤插件 : How to dynamically adjust the height of the content for each Step?

css - 当浏览器缩小时,如何保持要调整大小的图像高度?

css - Internet Explorer hover/rgba/opacity/css3 兼容性

javascript - IE7 中的 blockUI 插件内存泄漏 25kb

Internet Explorer 中的 PHP session 数据更改

Jquery 设置单独的输入边框颜色

php - 如何使用 PHP 从上传到本地主机的一个 html 文件重定向到磁盘上的另一个 html 文件?

css - 我怎样才能只继承 Bootstrap 预定义类的几个属性?

html - 在移动设备上禁用水平滚动不起作用