Pregunta

In the following situation, an <abbr> tag would certainly be semantically appropriate:

<p>The Olympic games coverage by the <abbr title="British Broadcasting Corporation">BBC</abbr> was highly praised.</p>

However, in some situations I need to truncate content with an ellipsis due to space constraints (rather than abbreviate using initials), and use the title attribute to describe the full content.

For example, say 'British Broadcasting Corporation' becomes 'British Broadcas...'. Would the <abbr> element still be the most semantically correct?

<abbr title="British Broadcasting Corporation">British Broadcas...</abbr>

NOTE

I am aware of the CSS text-overflow property, but AFAIK that only works on single-line text, whereas I need the text to wrap naturally where appropriate. I'm also not looking for a jQuery/Javascript solution, as the truncating happens on the back-end.

¿Fue útil?

Solución

<abbr> is meant for abbreviated text, so in my opinion it would be acceptable to use it for truncated text, as that is an abbreviated phrase. In the past, acronyms used to have their own tag <acronym>, but that has been deprecated in favor of using <abbr>.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top