SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stop alt tag pop-up on image hover

    Hey,

    I want to stop IE from displaying the alt attribute when the mouse is hovering over an image.

    I thought the following stopped this from occurring, but I have added it it to the HTML on the page and the alt tags are still appearing in a pop-up.

    <meta http=equiv="imagetoolbar" content="no">


    Does anyone know how I can do this correctly?

    Thanks in advance.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add title="" to the <img> tag.

    Code HTML4Strict:
    <img src="warning.png" alt="Warning!" title="">
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Adding a title tag will STOP the popover if i also call <meta http=equiv="imagetoolbar" content="no"> ?

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or does the title tag just need to be empty for the pop-up to be disabled?

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <meta> tag doesn't affect the tool-tips, only the image toolbar in IE.

    IE is incorrectly showing the alt attribute text in a tool-tip, something it copied from Netscape back in the '90s. Alt texts are meant to be displayed instead of the image, not along with it.

    The correct way of providing non-essential information with an image is to use the title attribute. IE shows the title if one is present, but will show the alt if there is no title. So by providing an empty title you prevent the alt from being shown, and since the title is empty it won't be shown either.
    Birnam wood is come to Dunsinane

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    or you could place some text in the title and then you will have the same tooltip appear in all browsers.
    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="^$">


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
  •