kaseytraeger Posted May 7, 2004 Posted May 7, 2004 Which tag attribute is the best to use in an anchor tag ... alt or title? For example, <a href="htt*://www.mywebsite.com" alt="Go to my new web site!">Go Now</a> versus <a href="htt*://www.mywebsite.com" title="Go to my new web site!">Go Now</a> Is it best to use both alt and title? The only problem I can see with that approach is the moderate increase in bandwidth that would result from having extra characters in your anchor tag. It may not be much if you have a few links, but for a page of bookmarks, for example, you could have many, many links, and that would draw eat your bandwidth considerably, especially on a popular page. Quote
boxturt Posted May 7, 2004 Posted May 7, 2004 Good question. I just recently discovered that the 'alt' tag doesn't work in Netscape 7.1 so I had to use the title tag instead (in addition to). That confuses me. Best? I honestly don't know, especially as i was always under the impression that the 'alt' and 'title' tags were 2 totally different things. Quote
Wilexa Posted May 7, 2004 Posted May 7, 2004 kasey, I would say to just go with the title attribute for anchor tags. The alt attribute isn't in the HTML spec for anchor tags. ...dave Quote
LisaJill Posted May 7, 2004 Posted May 7, 2004 (edited) alt for images, title for text links. alt = alternate way to display image title = more information on the link before clicking it The alt tag *does* work in Netscape; however it doesn't produce a hover effect (it doesn't in firefox either, but I have an extension installed to fix this.) the purpose of the alt tag isn't actually for that nice hover; but for people that can't get or see the images, to replace them or for screen-readers to read them.. the hover is just nice for those of us without accessibility issues. =) Edited May 7, 2004 by TCH-Lisa Quote
!!blue Posted May 20, 2004 Posted May 20, 2004 BTW: an image tag can have both the alt and the title attribute. The alt attribute shows up in case the image doesn't download and the title tag is what is *supposed* to show up when you hover over the image. So if you have a picture of your dog, it can be as follows: <img src="images/mydog.jpg" title="Kpax chilling on the lawn" alt="image of my pet dog Kpax" height="150" width="170" border="0"> Some browsers do this better than others. Sorry if it's off topic. later, !!blue Quote
DarqFlare Posted May 20, 2004 Posted May 20, 2004 title can be used on a lot of things. It can be used on form elements, even. Quote
Boojum Posted June 15, 2004 Posted June 15, 2004 Use "alt" (as I understand it, this is now actually required) for images. This is to allow nongraphical browsers, spiders and other visitors that can't see images to see a text placeholder. It will generally remain invisible, however, as long as your browser is set to display images. It is not designed for text links. "Title," on the other hand, is designed to provide purely elective additional information on either images or text. This will generally appear as a hover effect (depending on your browser) whether images can be seen or not; it is not a substitute for images, and it will therefore not satisfy the HTML alt requirement. As !!blue says, images can be assigned both alt and title tags—but, again, the former is required and the latter is not. Using alt for text, however, is not logical in that the text will appear no matter the visitor's settings, so there is nothing to substitute the tag for and no one will ever see it. Quote
Deverill Posted June 15, 2004 Posted June 15, 2004 Just for clarification, we are discussing the alt and title attributes. The title tag is <TITLE> Your site title. </TITLE> Quote
Boojum Posted June 15, 2004 Posted June 15, 2004 Jim is, of course, quite right: Alt is an attribute of an <img ...> tag, and title most commonly an attribute of <a href ...>. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.