Jump to content

title attribute


blogsmith

Recommended Posts

This should be adding a pop-up that says NAME because of your title attribute. Depending on the browser you use, they don't always show it. I know with Firefox it doesn't always show it but if I right click the image, I can see the title. If it's IE then it should show on mouse over.About the image being linked, you'll want to add the <a> element on both sides of your image. As shown below:

<a href="pagename.html"><img src="photo.jpg" title="NAME" border="0"></a>

Make sure to add border="0" in your image element or else you'll have an ugly border around it :)

Link to comment
Share on other sites

I also suggest adding a alt attribute to the img tag so it validates properly. In IE if you have an alt attribute it displays on hover, in firefox you need to use title. I always use both and here's why. Every page on my site is composed of many images, and I really don't want the word "spacer" to be visable when hovering over many areas on my site, so I use an alt attribute (alt="spacer") and a title attribute (title="") so it validates but doesnt display anything. Then if I do want something to display, I set both to the same text, so I maintain compatibility between browsers.

Link to comment
Share on other sites

I'd never use image tags for spacers though, that's a lot of unnecessary code. Use a div or something, and give it a background-image with repeat with css.

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...