SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Alternative Text not Showing

    Why does my alternative text show in IE, but not in Firefox or Opera?

    Example from my code....

    <a href="thumbs/weekendcrowdthumb.jpg"><img src="images/weekendcrowd.jpg" width="375" height="265" border="0" alt="A beautiful day in Atlantic City"></a>

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    FF does not show that. Unless you have the title attribute set for the link associated, if any.

  3. #3
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The alt attribute's text is supposed to show only if the image doesn't; it is the alternative to the image. IE gets it wrong. The title attribute is the correct one to use for a tooltip on hover.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  4. #4
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Since I cannot depend on that to indicate the contents of my photos, how do I put a caption under each? I have about three photos across, and quite a few down. I had tried to do captions prior, but had absolutely no luck centering them under each photo. Is there a way to do it with CSS?

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    To display a tooltip on any part of your web page use the title attribute. IE has a bug that copies the alt attribute into the title attribute on images where no title attribute is specified so you need to specify a title attribute on images to fix for that bug anyway.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Barnum View Post
    Since I cannot depend on that to indicate the contents of my photos, how do I put a caption under each? I have about three photos across, and quite a few down. I had tried to do captions prior, but had absolutely no luck centering them under each photo. Is there a way to do it with CSS?
    This is a different issue. It has been discussed several times in the css sub-forum. My offered solution is usually to use inline-block list items. Paul O'B has a demo also.

    Edit:

    See gallery post


    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •