Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Image change on hover without link

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #30593
    Kralle
    Participant

    Hello!

    Imagine two Photoshop layers, the bottom one has an orange image, and the top one contains a black image. When the mouse is hovering these images, the black image will disappear, and the orange image will appear. I’m looking for a CSS-trick which makes it possible for me to this, but WITHOUT any link-tags.

    Thanks in advance,
    Kralle

    #77876
    Chris Coyier
    Keymaster

    img:hover

    #77879
    Kralle
    Participant

    I don’t think there’s anything called img:hover?

    #77880
    Chris Coyier
    Keymaster

    Thats correct. Don’t ask me why I put that. What you can do is use a:hover and in the HTML put a # symbol in for the link.

    #77882
    Kralle
    Participant

    I know that. :) But I’m looking for a way to do this without any links.

    #77883
    Chris Coyier
    Keymaster

    Stumped

    #77852
    zackw
    Member

    whats wrong with using links?

    #77834
    coffeendonut
    Member

    This sounds like a job for sprites
















    #77808
    Bob
    Member

    I’d go with marcdefiants solution indeed. The problem with the :hover pseudo class is that it isn’t supported by IE5/6 on all elements, only on anchor links.

    #77787

    err, there *is* such a thing as img:hover, i don’t know when the last time was i heard that :hover only works on links, that’s only ie5

    #77788
    Chris Coyier
    Keymaster

    so img:hover does work?

    #77784
    Bob
    Member

    Yes, it should. The :hover pseudo class was originally designed for links, but after that, they also made it available to all other elements.

    #77776
    Chris Coyier
    Keymaster

    I knew I had read a tutorial saying it worked.

    #77777
    TheDoc
    Member

    It works, yes, but I believe there is some compatibility issues with earlier versions of IE – you might want to look into that.

    #77763
    zackw
    Member

    ie6 wont do img:hover or button:hover i know that

Viewing 15 posts - 1 through 15 (of 16 total)
  • The forum ‘CSS’ is closed to new topics and replies.