CSS 溢出 IE 与 FF

发布于 2024-08-19 19:22:02 字数 138 浏览 7 评论 0原文

我试图拥有一行数字,如果该行比 100 像素宽,我希望出现一个水平 (x) 滚动条。

这在 FireFox 中很容易实现,但 IE 不断折叠列表并给我一个垂直 (y) 滚动条,并且我想要右侧的项目出现在下面。

有人知道该怎么做吗?

I'm trying to have a single row of numbers, and if the row is wider than let's say 100 pixels, I want a horizontal (x) scrollbar to appear.

This is easy to achieve in FireFox, but IE keeps folding the list and giving me a vertical (y) scrollbar as well, and items that I want to the right are appearing below.

anyone know how to do this?

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

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

发布评论

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

评论(3

话少心凉 2024-08-26 19:22:02

尝试将“white-space”设置为“nowrap”。

Try to set the "white-space" to "nowrap".

归途 2024-08-26 19:22:02

您可以尝试将其放在 DIV 中并使 div 的位置绝对。
但正如我刚刚所做的那样,这可能会导致 FF / Chrome 出现问题。
因此,您可以在其中添加 IF 语句,例如:

            <!--[if IE]>
    <style>
            .content{
            position: absolute;
            }
            </style>
    <![endif]-->

我自己只是使用它来确保我的内容框架保持静止。 您可能需要合并告诉文本不要换行等。Gdluck

尽管出于您的目的,

编辑您甚至可以为您的 DIV ID 设置最小宽度?这可能也同样有效,但如果确实导致兼容性问题,请使用 IF 函数。

另请参阅 http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug IE 的盒子模型与 W3C 标准 + 其他信息的比较(如果您好奇为什么会发生问题)

You could try put it in a DIV and make the div's position absolute.
But as I was just working on that can cause issues with FF / Chrome.
So you can put an IF statement in such as :

            <!--[if IE]>
    <style>
            .content{
            position: absolute;
            }
            </style>
    <![endif]-->

I just used that myself to make sure my content frame sat still. Although for your purposes you may need to incorporate telling the text not to wrap etc.

Gdluck

EDIT You could even just set a min width to your DIV ID? That would probably work just as well but then again if does cause issues with compatibility use an IF function.

Also see http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug Shows variations on how the box model from IE compares to the W3C standard + other info (If your curious as to why the problem you have is happening)

携余温的黄昏 2024-08-26 19:22:02

由于IE和FF的盒模型存在差异,因此可能会发生这种情况,您需要增加内容区域的宽度(和/或高度)然后再查看。

Because of the fact that there are variations in box model for IE and FF, such thing can happen, you need to increase the width (and or height) of the content area and then see.

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