如何创建一个固定位置的div并与IE、FF和IE兼容铬合金

发布于 2024-10-10 03:24:10 字数 183 浏览 0 评论 0原文

我已将(位置)固定在左侧。它有 style="overflow: auto" ,然后其余的文章转到可滚动的右侧。

sidenav 中的某些选项在 IE 和 FF 中不可见。据我所知,浏览器视图端口对于不同的浏览器是不同的。如何调整 sidenav 的高度以使所有选项都可见。

我很感激任何帮助。

谢谢。

I have fixed(position) on the left. It has style="overflow: auto" and then the rest of articles go to the right which is scrollable.

Some of options in the sidenav is not visible in IE and FF. I understand that Browser view port are different for different browsers. How can I adjust the height of sidenav so that all options are visible.

I appreciate any help.

Thanks.

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

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

发布评论

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

评论(4

久光 2024-10-17 03:24:10

添加overflow-y:auto到sidenav,这将使sidenav内容在视口高度小于sidenav内容高度时可滚动。

add overflow-y:auto to the sidenav, this will make the sidenav content scrollable when the height of the viewport is lesser than that of the content in sidenav.

森林很绿却致人迷途 2024-10-17 03:24:10

看看这是否有帮助:

http://jsbin.com/ixula4

我所做的是添加 <代码>顶部:0; height: 100% 到固定定位的 div 以及 overflow: auto。似乎可以在 FF、Chrome 和 IE7(标准兼容模式)下工作。不确定其他浏览器是否如此。您最好研究一下“100% height divs”,以获取可以在其他浏览器中使用的技巧。

See if this helps:

http://jsbin.com/ixula4

What I've done is that that I added top: 0; height: 100% to the fixed positioned div along with overflow: auto. Seems to work in FF, Chrome and IE7 (standards-compliance mode). Not sure about other browsers. You better research on "100% height divs" for hacks you can use in other browsers.

情徒 2024-10-17 03:24:10

您可以尝试使用溢出:可见而不是自动。

还修复了仅从 IE7+ 开始,旧版 IE 不支持的问题。

您有示例页面可供查看吗?

You could try to use overflow:visible instead of auto.

Also fixed is not supported on older IE only from IE7+.

Do you have an example page to look at?

猫瑾少女 2024-10-17 03:24:10

这篇文章似乎对您非常有帮助,因为他们的演示似乎正是您想要做的。 http://cross-browser.com/x/examples/floater_fixed.html提供跨浏览器位置:固定的解决方案。

This article seems very helpful for you because their demo appears to be what you are trying to do. http://cross-browser.com/x/examples/floater_fixed.html Offers a cross-browser position:fixed solution.

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