Solved

image doesnt swap

Posted on 2013-05-17
3
240 Views
Last Modified: 2013-05-17
Hi,
My image doesnt swap on hover and I am not sure why. I just get a blank image on hover and I checked to make sure the image exists.

  <div id="headingIconList">
         <ul>
             <li>
              
                  <div id="ic1"><a href=""><img class="mimg"  src="../images/ic1.png" alt="head2"/></a></div>


#ic1{
	margin:0;
    padding:0;
    background-image:url(images/ic1b.png);
}


#ic1 a, a:link,  {
  display: block;
  width: 100px;
  height: 100px;
}
 
#ic1  a:hover img {
    visibility:hidden;
} 

Open in new window

0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:jagguy
ID: 39174478
I even tried this and it still doesnt swap
http://www.mymrt.net/ComputerTraining/test3.html
0
 
LVL 30

Expert Comment

by:LZ1
ID: 39174481
The CSS you give hides the #ic1 img when you hover the <a> tag. There is no "swap" function here. If you want to swap images this way, you'll need Javascript or jQuery.  You could do it with CSS if you used background images.

Can you show a live example so we can better see what your wanting to do?
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 39174497
Your HTML and CSS were both wrong.
Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">

#css-image-swap-1 {
    background: url("images/ic1.png") no-repeat scroll 0 0 transparent;
    height: 100px;
    width: 100px;
}
#css-image-swap-1:hover {
    background: url("images/ic1b.png") no-repeat scroll 0 0 transparent;
    height: 100px;
    width: 100px;
}

</style>
</head>

<body>

<div id="css-image-swap-1"></div>
</body>
</html>

Open in new window

0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question