Reputation: 1937
div {
width: 50px;
}
span {
display: inline-block;
}
p {
max-height: calc(1em + 5px);
}
<div>
<span>a</span>
<span><p class="ellipsis">b</p></span>
</div>
It seems when ellipsis is applied to the p it calculates the width as if it were the full width of the div, rather than its width - width of a (as they are display: inline)
I can see when I inspect that it calculates the ... as if it were the full width of div. Does anyone know a workaround for this (it works for the normal cases I use it in)?
Upvotes: 0
Views: 263