Jump to content

Proper use of <abbr/>?


Man In Tan

Recommended Posts

I'm starting college. Let's say, for the sake of having an example, that one of my classes is called "IT117: Introduction to Website Development". When I write about it in my weblog, I don't want to refer to it as "IT117: Introduction to Website Development" every time, because it's a pain to read, and doesn't fit into a sentence very well. However, I can't just refer to it as "IT117", because people would have to find the entry where I first mentioned the class by it's full name, or they wouldn't really know what the course was. I would also like to not have to redefine which classes I'm taking whenever I want to write about them. On option I thought about, was using the <abbr/> tag. Writing something such as "<abbr title="Introduction to Website Development">IT117</abbr>" would get the point across in most web browsers, including assistive technologies, while still appearing in the shorter notation when reading the entry. But is this a semantically correct way to write it? "IT117" isn't an abbreviation for "Introduction to Website Development", so I fear that it is not. Is there a more semantic way to achieve this effect? I think <dfn/> is closer to what I need semantically, but it is nowhere close as far as how it's actually used. Any advice would be greatly appreciated. Thank you for your time.

Link to comment
Share on other sites

Guest So Called

Maybe it would be better to write your websites for human beings and not worry about what is "semantically correct."

Link to comment
Share on other sites

The title attribute can be given to almost any element, so just put it on a <span> instead of <abbr>. You can use CSS to give the span an underline and chaange the cursor.

Link to comment
Share on other sites

To So Called:What you are emphasizing is about content quality, while semantics and valid markup have to do with code quality. Yes, I agree that content quality is very important, but both content quality and code quality contribute to overall page quality. If you choose one over the other, that is your choice to make, but I choose to have both. To Ingolme:For some reason, I was under the false impression that the "title" attribute had special meaning for <abbr/> and <acronym/> tag. Thanks for bringing the fact that this isn't the case t my attention. This will be useful in several other places as well. I really don't know where I got that idea.

Link to comment
Share on other sites

  • The <abbr/> defines an abbreviated text, so the reason the title attribute is !mportant and use along with it, is to present it full meaning to humans/marchines. EX:
    <abbr title='Hypertext markup language'>HTML</abbr>

  • The reason most people choose to use the <abbr/> TAG, is to make the source code more readable for users, who wish to view the source code,etc.

Edited by CodeName
Link to comment
Share on other sites

More readable, and more semantic. <span/>s and <div/>s are great, because of their lack of semantic meaning, but if a semantic option the fits the situation is available, I think it should be used. I doubt I'm the only one who feels that way, especially among people who would take the time to use <abbr/>s and <acronym/>s.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...