Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html IE6+IE7 CSS溢出问题:隐藏;-位置:相对位置;联合体_Html_Css_Internet Explorer 6_Internet Explorer 7_Overflow - Fatal编程技术网

Html IE6+IE7 CSS溢出问题:隐藏;-位置:相对位置;联合体

Html IE6+IE7 CSS溢出问题:隐藏;-位置:相对位置;联合体,html,css,internet-explorer-6,internet-explorer-7,overflow,Html,Css,Internet Explorer 6,Internet Explorer 7,Overflow,所以我为主页创建了一个滑动条,它使用jQuery滑动一些带有标题和摘要文本的图像。一切正常,我去检查IE,发现IE 6和7完全破坏了我的css。我不知道为什么,但出于某种原因,我无法用溢出隐藏非活动幻灯片:隐藏;我已经试着前后调整css,但还不能找出问题的原因 我在一个更孤立的html页面中重新创建了这个问题 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/x

所以我为主页创建了一个滑动条,它使用jQuery滑动一些带有标题和摘要文本的图像。一切正常,我去检查IE,发现IE 6和7完全破坏了我的css。我不知道为什么,但出于某种原因,我无法用溢出隐藏非活动幻灯片:隐藏;我已经试着前后调整css,但还不能找出问题的原因

我在一个更孤立的html页面中重新创建了这个问题

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="da" dir="ltr">
  <head>
    <style>
      body {
       width: 900px;
      }
      .column-1 {
        width: 500px;
        float: left;
      }
      .column-2 {
        width: 200px;
        float: left;
      }
      .column-3 {
        width: 200px;
        float: left;
      } 
      ul {
        width: 2000px;
        left: -499px;
        position: relative;
      }

      li {
        list-style: none;
        display: block;
        float: left;
      }

      .item-list {
        overflow: hidden;
        width: 499px;
      }
    </style>
  </head>
  <body>
    <div class="column-1">
      <div class="item-list clearfix">
        <ul>
          <li class="first">
            <div class="node-slide">
              <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" />
              <div class="infobox">
                <h4>Title 1</h4>
                <p>Teaser 1</p>
              </div>
            </div>
          </li>
          <li>
            <div class="slide">
              <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" />
              <div class="infobox">
                <h4>Title 2</h4>
                <p>Teaser 2</p>
              </div>
            </div>
          </li>
          <li class="last">
            <div class="slide">
              <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" />
              <div class="infobox">
                <h4>Title 3</h4>
                <p>Teaser 3</p>
              </div>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <div class="column-2">
      ...
    </div>
    <div class="column-3">
      ...
    </div>
  </body>
</html>

关于导致溢出的ul元素:hidden不起作用,但原因是什么,我不知道。此外,还需要使用ul上的left属性来滑动滑块javascript。任何关于如何解决这个问题的想法都是非常受欢迎的。

这个问题显然是针对IE6+7的,IE8已经解决了这个问题

为了避免这种情况,在这种情况下,您可以更换:

ul {
    left: -499px;
    position: relative;
  }
与:


然而,这给了我在infobox div上使用的背景带来了一些问题,但我用一些风格上的技巧解决不了任何问题。

这是IE6和IE7中一个众所周知的错误。要解决此问题,需要添加位置:相对于容器。因为在您的示例中,body是容器,所以我建议您在body的正下方添加一个div,并给它一个位置:relative。这应该可以解决你的问题。

试着把你的问题放在正确的位置…@Jer问题显然不是我的复制/粘贴缺陷。救了我一天。。。我的意思是晚上很好的暗示!我花了这么长时间才找到这个帖子!我讨厌你!我将此技术用于背景大小:在IE7中,通过使用具有绝对位置的内联图像进行覆盖复制。谢谢同样的问题在这里,设置位置:相对;对ul的父母做了这个把戏。非常感谢!
ul {
    left: -499px;
    position: relative;
  }
ul {
    margin-left: -499px;
  }