Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Objects Images

erikanicosia
erikanicosia
7,788 Points

Image title does not show up in Chrome

Can anyone tell me why when I use Chrome my image title does not show up (when I hover over the image), but when I use IE it does?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi Erika, would you be able to post your code for us?

the alt tag on all images should work for all browsers. If not maybe try the title attribute. :-)

erikanicosia
erikanicosia
7,788 Points

Here is my code. Thanks!

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>MyPage</title>

    </head>

    <body>
        <p>This is a photo of the salt marsh at Fire Island National Seashore</p>
        <img src="Fire_Island.jpg" alt="Photo of a salt marsh at Fire Island National Seashore" title="Fire Island salt marsh">
        <p>Isn't it lovely?"</p>    

    </body>

</html>

3 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

There's no reason the alt tag itself shoudn't work. It's fully comptable with Chrome. :-)

So I did a little digging and found this link. http://www.paciellogroup.com/blog/2010/01/alt-and-title-content-display-in-popular-browsers/

Try a shorter alt tag and see if it shows up, Seems Chrome doesn't display the text if it's bigger than the actual width of the image. :-)

erikanicosia
erikanicosia
7,788 Points

Hi Jonathan, That link you provided helped a bit. I thought if I used the title tag, the text would appear regardless of whether or not the image was available, and with the alt tag the text would appear only if the image was NOT available. I removed the image from the folder and now the title tag works. From the link you sent, it sounds like there will be differences in how these tags works across browsers. Obviously not UBER important, but I'm a newbie and so I'm trying to understand everything. Thanks!

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Also, you don't need anything in the alt tag because if people have the computer read to them the contents on the screen they will know what it is because you have a description above the image.

erikanicosia
erikanicosia
7,788 Points

Yeah, I get that I don't really need anything, but I'm following along with the lesson and trying to learn how things work. I just don't understand why it will work in one browser and not the other even after I shortened the alt (or title) tag. I even removed the alt tag, replaced it with title tag--and it still won't work in Chrome!

'''html

<body>
    <p>This is a photo of the salt marsh at Fire Island National Seashore</p>
    <img src="Fire_Island.jpg" title="salt marsh">
    <p>Isn't it lovely?</p> 

</body>

</html> '''