Decision
You have overflow: hidden applied to .song-title .
It should also be with the parent:
.song-wrapper { overflow: hidden; background: beige; display: flex; flex-grow: 1; }
.wrapper { display: flex; align-items: center; } ul { display: inline-block; list-style: none; flex-shrink: 0; } li { display: inline-block; width: 30px; height: 30px; background: red; margin-right: 3px; } .song-wrapper { background: beige; display: flex; flex-grow: 1; overflow: hidden; } .song-title { background: aqua; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; }
<div class="wrapper"> <ul> <li></li> <li></li> <li></li> </ul> <div class="song-wrapper"> <span>1:23</span> <span class="song-title">This is the song title and I want it to ellipsize if the screen shrinks</span> <span>4:22</span> </div> </div>
modified violin
Description
Both .song-wrapper and .song-title are flexible elements.
.song-wrapper is a child of the main flex container ( .wrapper ), and .song-title is a child of the nested flex container ( .song-wrapper ).
By default, the flexibility item cannot be smaller than the size of its contents. Initial setting of the element element min-width: auto . This means that the text in the flex element sets the minimum width.
To override this option, you can use min-width: 0 or overflow: hidden .
Although you used overflow: hidden for .song-title , you had nothing to override min-width: auto on .song-wrapper .
See this post for a more detailed explanation:
source share