Disappear Hyperlink Text on Hover

I have a hyperlink, I want to have an arrow image next to text normally, but on hover, I want the text to go away and an image to display instead.

here is my code:

#MenuHome a
{
    display: block;
    font-family: Tahoma, Arial, Verdana;
    font-size: 12px;
    color: white;
    width: 65px;
    height: 23px;
    text-decoration: none;
    background: none;
    text-align: center;
    font-weight: bold;
    vertical-align: middle;
}


#MenuHome a:hover
{
    background: url( "images/home.gif" ) no-repeat center center;
}

Right now, on hover, the image displays behind the text, but I want the text go disappear.

thanks.
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yo_s_cantaCommented:
Hello,

Try this code .....

Have a nice day,
Andrew
<style>
	#myid {
		background:white;
		border:1px solid black;
		display:block;
		height:20px;
		width:100px;
	}
	#myid:hover { 
		background:red;
	}
	#myid:hover div {
		display:none;
	}
</style>
<a id="myid">
    <div id="text">Button</div>
</a>

Open in new window

0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
That makes my home.gif image disappear too.

Please look at MY example....

#MenuHome a:hover
{
    background: url( "images/home.gif" ) no-repeat center center;
}



0
yo_s_cantaCommented:
Try now
<style>
        #myid {
                background:white;
                border:1px solid black;
                display:block;
                height:20px;
                width:100px;
        }
        #myid:hover { 
                background:url( "images/home.gif" ) no-repeat center center;
        }
        #myid:hover div {
                display:none;
        }
</style>
<a id="myid">
    <div id="text">Button</div>
</a>

Open in new window

0
WarpsehCommented:
How about this?
<div id="MenuHome">
<img src="arrow.gif" /><a href="#"><span>Go</span></a>
 
#MenuHome a
{
    display: block;
    font-family: Tahoma, Arial, Verdana;
    font-size: 12px;
    color: white;
    width: 65px;
    height: 23px;
    text-decoration: none;
    background: none;
    text-align: center;
    font-weight: bold;
    vertical-align: middle;
}
 
 
#MenuHome a:hover
{
    background: url( "images/home.gif" ) no-repeat center center;
}
 
#MenuHome a:hover span
{
    display: none;
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
Warpseh's solution works perfectly. Yo's wasn't quite there and still didn't work. But I gave you points for getting close.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.