CSS中overflow-y的替代方案?

发布于 2024-10-10 17:06:29 字数 186 浏览 6 评论 0原文

行为

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

我正在创建一个日历,需要复制不支持这些 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 don'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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

π浅易 2024-10-17 17:06:29

有人问了大致相同的问题(overflow-x 可见,-y 隐藏)。
http://forums.devnetwork.net/viewtopic.php?f=68& ;t=116457

一个名叫 Weirdan 的人说 我想说没有任何预期的行为,因为这种风格不可避免地存在内部不一致,并显示了一个示例,其中不清楚(Weirdan 说)该区域是否东南方应隐藏或显示。

她/他还说你想要的效果很容易通过用另一个div包裹外部div并将该div上的overflow-y设置为隐藏来实现,并显示这个示例(我希望我可以将其复制到这里吗?)。

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

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文