I have the following HTML:
<td class='a'>
<img src='/images/some_icon.png' alt='Some Icon' />
<span>Some content that's waaaaaaaaay too long to fit in the allotted space, but which can get cut off.</span>
</td>
It should display as follows:
[Some content that's wa [ICON]]
I have the following CSS:
td.a span {
overflow: hidden;
white-space: nowrap;
z-index: 1;
}
td.a img {
display: block;
float: right;
z-index: 2;
}
When I resize the browser to cut off the text, it cuts off at the edge of the <td>
rather than before the <img>
, which leaves the <img>
overlapping the <span>
content. I've tried various padding
and margin
s, but nothing seemed to work. Is this possible?
NB: It's very difficult to add a <td>
that just contains the <img>
here. If it were easy, I'd just do that :)