滚动条显示他们不应该使用IE 7,为什么?

时间:2013-02-15 15:54:22

标签: css positioning

我设计了一个div,其中包含的内容可能会因以下方式而有所不同:

div.myDiv {
   display:inline-block;
   *display:inline;/* For IE7*/
   *zoom:1;/* For IE7*/
   white-space:normal;
   vertical-align:top; max-width:280px; overflow:auto; 
}

意图是限制元素的扩展超过280像素并让内容垂直增长,因为我有一个溢出:auto on container元素。这适用于除IE7之外的所有浏览器。我不确定偏移是否与此问题有关?

enter image description here

编辑:Here is我设置了jsfiddle以演示我的场景,但我甚至无法用IE9查看jsfiddle(在IE 7模式下运行)。希望这有助于理解我所面临的问题。 有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试设置overflow:hidden

div.myDiv {
   display:inline-block;
   *display:inline;/* For IE7*/
   *zoom:1;/* For IE7*/
   white-space:normal;
   vertical-align:top; max-width:280px; overflow:auto; 

   /*This line should hide the scrollbar*/

   *overflow:hidden;
}