I found that the text ellipsis set in .inner_right
does not work. After testing, I added overflow: hidden
to the .left
box, and the ellipsis appeared. how to explain this situation?
.box {
height: 100px;
width: 100%;
display: flex;
}
.left {
flex: 1;
display: flex;
background-color: blue;
/* overflow: hidden; It will not work without adding this */
}
.right {
width: 200px;
background-color: black;
}
.left .inner_left {
width: 100px;
background-color: antiquewhite;
}
.left .inner_right {
flex: 1;
background-color: aquamarine;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
<div class="box">
<div class="left">
<div class="inner_left"></div>
<div class="inner_right">
some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text
</div>
</div>
<div class="right"></div>
</div>