I have multiple non-wrapping, inline child elements within a parent div that has a set width
and text-overflow
set to ellipsis
.
When the last child is an anchor tag, the ellipses work fine, but when it's an input, the text just clips. Because the preceding items are variable width, I can't set a reasonable max width on the last input.
.parent {
width: 120px;
background: #eee;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
<div class="parent">
<span class="child1">
<a href="#">link 1</a> text
<a href="#">Lorem ipsum dolor</a>
</span>
</div>
<div class="parent">
<span class="child1">
<a href="#">link 2</a> text
<input type="submit" class="request-topic-link" value="lorem-ipsum-dolor">
</span>
</div>
Any suggestions? Here's a JSFiddle.
text-overflow
is designed to work on text, not input elements. – Incommunicable