开发者

Alternative to overflow-y in CSS?

I'm creating a calendar and need to replicate the behaviour I would get with

overflow-x:visible;
overflow-y:hidden;

for browsers that d开发者_开发技巧on't support these css attributes. Is there some kind of workaround I can do? I don't just want to compromise and add in overflow:hidden for those browsers, since the client really wants this feature. Does anyone have any good ideas?

Many thanks.


Here is someone who asks roughly the same question (overflow-x visible and -y hidden).
http://forums.devnetwork.net/viewtopic.php?f=68&t=116457

Someone named Weirdan says I'd say there's isn't any expected behavior because such style is unavoidably internally inconsistent, and shows an example where it is not clear (says Weirdan) whether the area to the southeast should be hidden or shown.

S/he also says that the effect you want is easily achieved by wrapping the outer div with another div and setting overflow-y on that div to hidden, and shows this example (I hope it's OK that I copy it to here?).

<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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜