Css 问题Firefox文本溢出:子元素上的省略号

Css 问题Firefox文本溢出:子元素上的省略号,css,firefox,Css,Firefox,具有父div和子div <div class="div-parent"> <div class="div-child"> Oportunum est, ut arbitror, explanare nunc causam. </div> </div> 在Chrome上,文本被截断,并根据需要添加“…” 但在Firefox上,文本只被截断 有什么想法吗?我认为Firefox做的是正确的,因为从技术上讲,子div被设

具有父div和子div

<div class="div-parent">
    <div class="div-child">
        Oportunum est, ut arbitror, explanare nunc causam.
    </div>
</div>
在Chrome上,文本被截断,并根据需要添加“…”

但在Firefox上,文本只被截断

有什么想法吗?

我认为Firefox做的是正确的,因为从技术上讲,子div被设置为
inline block
,因此它将适合其内容,并且会溢出父元素。因此,
内联块
溢出的不是文本

您应该使子
宽度:100%
产生文本溢出,并将属性移动到子div:

.div父项{
边框:实心1px黑色;
宽度:200px;
空白:nowrap;
}
D.分区儿童{
显示:内联块;
宽度:100%;
溢出:隐藏;
文本溢出:省略号;
}

这是一个机会,但不是仲裁人,是解释原因的机会,是一个存在于贵族阶层的现实,是一个持久的家庭。nec enim super hoc ulla documentorum rata est fides。

是的,我同意,但是,这种风格是在我使用的一个库中定义的,在进入库风格之前,我想了解它为什么不在firefox上工作。@ThomasBihan Poudec问题可能是:为什么它在Chrome上工作。。对我来说,Chrome似乎不应该添加省略号
.div-parent {
    border: solid 1px black;
    width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.div-child {
    display: inline-block;
}