时间:2011-01-06 19:42:33

标签: css overflow hidden visible

1 个答案:

答案 0 :(得分:5)

这是一个大致相同问题的人(overflow-x visible和-y hidden) http://forums.devnetwork.net/viewtopic.php?f=68&t=116457

名为 Weirdan 的人说I'd say there's isn't any expected behavior because such style is unavoidably internally inconsistent,并显示了一个不清楚的例子(Weirdan说)是否应该隐藏或显示东南区域。

他/她也说the effect you want is easily achieved by wrapping the outer div with another div and setting overflow-y on that div to hidden,并显示了这个例子(我希望我把它复制到这里可以吗?)。

<style type="text/css">
#outer-wrapper {
    overflow-y:hidden;
}
#outer {
  width:100px;
  height:100px;
  background:red;
  border:solid red 1px;
  overflow:visible;
}
#inner {
  width:200px;
  height:200px;
  background:green;
}​
</style>
<div id="outer-wrapper">
  <div id="outer">
    <div id="inner"></div>
  </div>
</div>