溢出:自动在 Firefox 中不起作用 [英] Overflow: auto does not work in Firefox

查看:24
本文介绍了溢出:自动在 Firefox 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子.它的 overflow: auto.

宽度设置为 100px.在仅限 Firefox 中,超过 100 像素的文本不会隐藏并替换为滚动条.

当内容超过其容器的宽度时,如何隐藏内容并拥有滚动条?

http://jsfiddle.net/be6tM/10/

解决方案

this question from 这里 也许可以解决你的问题

nickb 答案:尝试将其包装在

中. 我很确定没有为 <td> 元素定义溢出属性,至少在 HTML4 不是."

尝试将您的 overflow:auto 放入 wrapper 希望这可以帮助您

pre, div {宽度:100%;溢出:自动!重要;}

工作 演示

I have a table. Its <td> have overflow: auto.

The width is set to be 100px. In Firefox only, text that exceeds 100px is not hidden and replaced with a scrollbar.

How can I hide content and have a scrollbar when it exceeds the width of its container?

http://jsfiddle.net/be6tM/10/

解决方案

this question from here maybe solve your problem

nickb answer: "Try wrapping it in a <div>. I'm pretty sure the overflow attribute is not defined for a <td> element, at least in HTML4 it's not."

try to put your overflow:auto to the wrapper hope this can help you

pre, div {
    width:100%;
    overflow: auto !important;
}

working demo

这篇关于溢出:自动在 Firefox 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆