Floating text over photos

Discussion in 'Web Design and Development' started by StokeLee, Sep 10, 2006.

  1. StokeLee macrumors 6502

    StokeLee

    Joined:
    May 30, 2005
    Location:
    Stoke-on-Trent. Midlands, UK
    #1
    Sorry about the strange heading, im really not sure what to call it.

    This is what i want to do.

    Im going to change my .mac website, and use the advanced html option.

    How can i display a name, or comment, if i hover my mouse over a photo.

    What is the html i need to use.

    Thank you

    Lee
     
  2. Oryan macrumors 6502a

    Oryan

    Joined:
    Apr 1, 2005
    Location:
    Lincoln, NE
    #2
    Do you mean a tool tip or actually showing some text somewhere else on the page?
     
  3. dornoforpyros macrumors 68040

    dornoforpyros

    Joined:
    Oct 19, 2004
    Location:
    Calgary, AB
    #3
    <img src="images/happyguy.gif" .... alt="Happy Smiling Guy">

    you just need to include alt="something here" in your image tags.
     
  4. zosont macrumors newbie

    Joined:
    Aug 25, 2006
    #4
    This is not true, the correct attribute is title, the alt attribute is for alternative text - text meant as a possible replacement for the image to make it accessible to non-graphic browsers (which incidentally include search engines).
    The fact that some (but certainly not all) browsers display alt text as a tooltip is actually an error on their part.
    Code:
    <img src="photo.jpg" title="tooltip text here" alt="alternative text here" />
    Hope this helps
     
  5. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #5
    That is right... and why I often put the same text into both the alt and the title attributes, just to be on the safe side... :)

    Like this (just steaing zosont's example ;)):
    PHP:
    <img src="photo.jpg" title="tooltip text here" alt="tooltip text here" />
    That should work also for the large, stupid majority of browser users... ;)
     
  6. dornoforpyros macrumors 68040

    dornoforpyros

    Joined:
    Oct 19, 2004
    Location:
    Calgary, AB
    #6
    oops, silly me coding the browsers people use again :p

    damn M$ teaching bad habits
     
  7. StokeLee thread starter macrumors 6502

    StokeLee

    Joined:
    May 30, 2005
    Location:
    Stoke-on-Trent. Midlands, UK
    #7
    Cool cheers guys,

    I want it to show either a comment about the photo, or the person/s name.
     
  8. JGruber macrumors 6502

    Joined:
    Feb 13, 2006
    #8
    You can always get all fancy and use overLIB to achive this... but that is a little more advanced.
     

Share This Page