Hover over an image and insert text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pamel

    Hover over an image and insert text

    I currently have a page that has 6 images in a row. Using javascript,
    when the mouse goes over one of the images, a word is placed below the
    images. Each image has a different word. I am trying to change this
    to happen through CSS. I think I might be able to use a hover
    technique similar to the one used here:



    Focusing specifically on this line:

    ul#navlist li:hover ul#subnavlist li a:before { content: " >> "; }

    I was thinking of something like:

    img#image1:hove r p#textarea a:before { content: "some text"; }

    Where the image1 is what the mouse needs to be over and the textarea
    contains a link that the text needs to be placed before. But for the
    life of me I have been unable to get it to work. I think it may have
    to do with the heirarchy of elements, but I'm just not sure. Am I on
    the right track, or is there a better way to do this?
  • Brian

    #2
    Re: Hover over an image and insert text

    Pamel wrote:
    [color=blue]
    > img#image1:hove r p#textarea a:before { content: "some text"; }
    >
    > Where the image1 is what the mouse needs to be over and the textarea
    > contains a link that the text needs to be placed before. But for the
    > life of me I have been unable to get it to work.[/color]

    IE/Win does not support css generated content. Does that explain
    what's wrong?
    [color=blue]
    > I think it may have
    > to do with the heirarchy of elements, but I'm just not sure.[/color]

    Neither am I, without more information. What browser is this failing
    in? What is the url?

    --
    Brian (remove ".invalid" to email me)

    Comment

    • Pamel

      #3
      Re: Hover over an image and insert text

      "Brian" wrote...[color=blue]
      > Pamel wrote:
      >[color=green]
      > > img#image1:hove r p#textarea a:before { content: "some text"; }
      > >
      > > Where the image1 is what the mouse needs to be over and the textarea
      > > contains a link that the text needs to be placed before. But for the
      > > life of me I have been unable to get it to work.[/color]
      >
      > IE/Win does not support css generated content. Does that explain
      > what's wrong?[/color]

      It doesn't work in either IE or Firebird 0.9. Honestly I didn't expect it to
      work in IE, and I really don't care if it does.
      [color=blue][color=green]
      > > I think it may have
      > > to do with the heirarchy of elements, but I'm just not sure.[/color]
      >
      > Neither am I, without more information. What browser is this failing
      > in? What is the url?[/color]



      It isn't just the before/content stuff, I can't get any hover effect to affect
      anything other than stuff immediately around it.


      Pamel






      ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
      http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
      ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

      Comment

      Working...