mouseOver effect using CSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alberto Perez
    New Member
    • Feb 2012
    • 2

    mouseOver effect using CSS

    I've been trying to create an image mouseOver effect using CSS without any success. My current css code is:

    <a href="docs/sorry.html"><im g src="images/member.jpg" width=190 height=45 border=0><a/>

    the other image is located in the same place and called "member2.jp g"

    Can you help please.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The HTML should be nested something like this:
    Code:
    <a><div></div></a>
    Then your css should use a different background image using the hover.

    Or if you don't want to store the image paths in the css sheet, you could nest the HTML like this:
    Code:
    <a><img><img></a>
    And use CSS to toggle visibility or z-index.

    Comment

    • Alberto Perez
      New Member
      • Feb 2012
      • 2

      #3
      I'm sorry Rabbit, but I don't understand your answer. Can you be a little more specific?

      I've been trying to create an image mouseOver effect using CSS without any success. My current css code is:

      <a href="docs/sorry.html"><im g src="images/member.jpg" width=190 height=45 border=0><a/>

      the other image is located in the same place and called "member2.jp g"

      Can you try to help me again, please.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        If you're going to go the image route, you need both image elements in there. Then you can use the on hover to toggle the visibility of your image elements or modify the z-index.

        Comment

        Working...