SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast smilinjack's Avatar
    Join Date
    Nov 2004
    Location
    Wilds of Borneo And the vineyards of Bordeaux
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Adding ALT TAG to text in HTML

    Greetings,
    How can I add "Alt Tags" to text.
    Easy to do to images but can't figure it out on text.
    As always thanks in advance!!!

    Jack
    North to Alaska !

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    use the TITLE attribute instead

    by the way, ALT is not a tag, it is an attribute of the IMG tag
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not just the img element but AREA, APPLET, and INPUT as well...

    But like I said in another forum you posted ... what would be the purpose of adding an alt (or title) attribute? ALT is to add alternate text for when you have an image or an element you are using that doesn't display text, and title is basically the same thing.

    The alt and title attributes

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ALT is an attribute which provides alternate content (a text equivalent) for non-textual information. It is displayed, for instance, instead of an image, if the image is unavailable or unsupported.

    You can't have a text equivalent for text, that would be displayed instead of the text, because it defies reason.

    If you want a tool-tip 'popup' for some text, use the TITLE attribute like Rudy said. Wrap the text in a SPAN if you don't have any other, more semantical, element type on which to set the attribute.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast smilinjack's Avatar
    Join Date
    Nov 2004
    Location
    Wilds of Borneo And the vineyards of Bordeaux
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Adding ALt Tag text

    Could you give me a short example of that coding?

    Thanks,
    Jack
    North to Alaska !

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    <p title="this is a tooltip">this is the paragraph</p>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    the title attribute is especially useful for text links that will take the user away from the page they are reading.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  8. #8
    SitePoint Enthusiast smilinjack's Avatar
    Join Date
    Nov 2004
    Location
    Wilds of Borneo And the vineyards of Bordeaux
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Adding ALt Tag text

    Thanks to all for your help!

    Jack
    North to Alaska !

  9. #9
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    People get confused because IE shows the alt text as a tooltip when there is no title present. Which is wrong.

  10. #10
    SitePoint Enthusiast jeffrey.pry's Avatar
    Join Date
    Oct 2006
    Location
    United States of America
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by ALT tag, that's an image tag...
    -----------------
    Jeffrey Kevin Pry

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lots of people say ALT tag when they mean ALT attribute.
    Birnam wood is come to Dunsinane


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
  •