2013-03-08 77 views
1

这是我的CSS;我需要它的所有内容都有滚动或自动溢出。我不明白为什么它没有显示出来。为什么溢出不能在这里工作?

.holder{ 
    display: table; 
    position: relative; 
    margin-left: auto; 
    margin-right: auto; 
    top: 2.5%; 
    width: 90%; 
    height: 95%; 
    background-image:url("images\\tile2.png"); 
    background-repeat:repeat; 
    overflow: scroll; 
} 
+1

请添加与HTML标记你的问题。 – adamb 2013-03-08 16:45:05

回答

1

删除display: table;您将看到滚动条。

活生生的例子:http://jsbin.com/aloler/1/edit

这里是你的代码display: table;删除:http://jsbin.com/aloler/2/

+0

这工作谢谢!溢出是否在桌面显示中不起作用,还是导致这种情况的糟糕决定的组合? – 2013-03-08 16:50:52

+0

@VladOtrocol,不确定。 'display:table;'将元素视为'

'。在它周围搜索看起来像让滚动条使用表需要一些解决方法。我无法找到两者不兼容的确切原因。 – JSuar2013-03-08 16:55:58

+0

@VladOtrocol,有一些很好的信息。这里(包括解决方法)关于表和溢出在这里:http://stackoverflow.com/a/4457290/1085891 – JSuar 2013-03-08 16:58:25