【问题标题】:CSS overflow-x and white-space effect not working on Firefox (but working on Chrome)CSS 溢出-x 和空白效果不适用于 Firefox(但适用于 Chrome)
【发布时间】:2015-12-08 20:00:17
【问题描述】:

我有一个表,其中有一列包含一长串文本。我希望此列具有固定的小宽度,并具有水平滚动条。为此,我对长列使用以下样式:

.foo { 
    white-space: nowrap;
    max-width: 400px;
    overflow-x:scroll;
}

这是一个工作示例: jsfiddle.net/7Ld6c0vv

在 Chrome 中,一切正常。但在 Firefox 中,没有滚动条,并且列中的文本超出了列边界。

我使用的是 Google Chrome 版本 47.0.2526.73 和 Firefox 42.0。

如何修改它以使 Chrome 中的效果也出现在 Firefox 中?

【问题讨论】:

标签: html css google-chrome firefox


【解决方案1】:

这对你有用吗:https://jsfiddle.net/7Ld6c0vv/2/ ?

使用包含在 td 中的<div class="foo">:

<td><div class="foo">lhaoh oah ohgoa ngoa nhoganho gaoh goahg oaehgo eoghaogh aog aoghj aohg oehgo hegohao goah goeahgo aewhog haeoghaeo ghoae wgoiawhoeh ofhaioeh oag</div></td>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-07
    • 1970-01-01
    • 1970-01-01
    • 2018-05-05
    • 2015-02-20
    • 1970-01-01
    • 2019-01-11
    相关资源
    最近更新 更多