I have two items that look like this
span.left {
float: left;
display: inline-block;
/* Take space neccessary */
}
span.middle {
/* Take free space only, do not push unless allowed */
/* Contains couple lines of text */
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
span.right {
/* Take space neccessary */
float: right;
display: inline-block;
}
Unlike previous request. This one can't use flexbox and can't be reliant on JavaScript.
span.left
and span.right
are both elements that are allowed to widen up as much as they want while.
span.middle
has to shrink if forced and grow if it's allowed (by it's remaining width).
I tried to the typical float: X
and width: 100%;
trick, but span.right
didn't make it to the first line and ended up being below span.middle
on the right side.
Oh, and I forgot, span.left
and span.right
can be of flexible length.