vet911 Posted November 12, 2010 Share Posted November 12, 2010 I need some help with an alt tag for an image. I can't get it to show up, your help will be appreciated. This is my code inside a div. I need it to show up when you move your mouse over the image like it would normally do. Because of the php code I can't seem to find out how to do it. <div style="float: left;"><a href="tn1_1.php?search=<?php echo $title; ?>"><img src="<?php echo $tn; ?>"><h4><?php echo $title; ?></h4></a></div> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 12, 2010 Share Posted November 12, 2010 The text that displays when you leave the cursor over an image doesn't go in the alt= attribute, it goes in the title= attribute, which isn't even present in your <img> tag set. Quote Link to comment Share on other sites More sharing options...
Dragosvr92 Posted November 12, 2010 Share Posted November 12, 2010 <div style="float: left;"> <a href="tn1_1.php?search=<?php echo $title; ?>"> <img src="<?php echo $tn; ?>" title="<?php echo $title; ?>" alt="<?php echo $title; ?>" /> <h4><?php echo $title; ?></h4> </a> </div> I Think thats what you are after ... Quote Link to comment Share on other sites More sharing options...
vet911 Posted November 12, 2010 Author Share Posted November 12, 2010 Thank you, that worked perfectly. I found out that the alt tag is for images that don't show up and the title tag was what I wanted. Thanks again. Quote Link to comment Share on other sites More sharing options...
Dragosvr92 Posted November 12, 2010 Share Posted November 12, 2010 No Problem But you should keep the alt tag also in case your server is slow when loading the images etc or just to validate your Page on W3C Quote Link to comment Share on other sites More sharing options...
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.