Big*_*ood 5 html css firefox language-lawyer
据我了解,文本溢出仅适用于内联元素:
此属性指定当内联内容在其块容器元素(“块”)的内联行进方向上溢出其线框边缘时发生的渲染,该块容器元素(而不是可见的)发生了溢出。
Firefox(在66.0.2 64位,macOS和其他可能的Gecko浏览器上进行了测试)然后不应该省略内联代码块,而且它的运行方式很怪异:它将整个内联代码块减少为“…” 。请参见下面的代码片段进行演示。
我在规格方面有什么遗漏吗,还是壁虎在这一点上错了?
我的问题涉及这些规格:
.wrapper {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
height: 40px;
border: 1px solid lightgray;
position: relative;
}
.wrapper div {
display: inline-block;
vertical-align: middle;
}
.wrapper img {
vertical-align: middle;
}
.block {
width: 40px;
height: 40px;
background: red;
}Run Code Online (Sandbox Code Playgroud)
<small>?? Case 0 : ellipsis, preceding inline-block and contained text in inline-block</small>
<div class="wrapper">
<div class="block"></div>
<div>I'm not concerned by ellipsis for now.</div>
</div>
<font color="firefox, damn">? Case 1 : ellipsis, preceding inline-block and overflowing text in inline-block</font>
<div class="wrapper">
<div class="block"></div>
<div>I'm a text so long I'll overflow for sure, cause there is no space for me in this world, I'm doomed and you know it well. Why would you even wrap me in a div? A div? Do you hate me?</div>
</div>
<small>? Case 2 : ellipsis, no preceding block and overflowing text in inline-block</small>
<div class="wrapper">
<div>I'm a text so long I'll overflow for sure, cause there is no space for me in this world, I'm doomed and you know it well. Why would you even wrap me in a div? A div? Do you hate me?</div>
</div>
<small>? Case 3 : ellipsis, no preceding block and overflowing text in a span (inlined by default)</small>
<div class="wrapper">
<img src="https://placekitten.com/40/40">
<span>I'm a text so long I'll overflow for sure, cause there is no space for me in this world, I'm doomed and you know it well. Why would you even wrap me in a div? A div? Do you hate me?</span>
</div>
<small>? Case 4 : ellipsis, span all over the place and overflowing second text</small>
<div class="wrapper">
<span>I'm a first text.</span>
<span>I'm a text so long I'll overflow for sure, cause there is no space for me in this world, I'm doomed and you know it well. Why would you even wrap me in a div? A div? Do you hate me?</span>
</div>Run Code Online (Sandbox Code Playgroud)