Assume the following:
<li>
<strong>Name:</strong>
<span>John Doe</span>
</li>
The label part (the string in the <strong>
tag) and the value part (the string in the <span>
tag) can have any length. So, sometimes the label might be long and the value might be short, or vice versa, or both short, or both long.
When the combined width of the label and value exceeds a specified width, I'd like the tail-end of the concatenated string to display ellipsis. How do I do this in CSS?
UPDATE: what if the markup looked like this?
<dl>
<dd>Name:</dd>
<dt>John Doe</dt>
</dl>