|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
css rollover
I have this code which changes text into a image, but how do I have an image instead of text? I mean so everythings images and no text.
<style type="text/css"> #nav a:hover { background: url("arrow_hover.png") no-repeat; } #nav a img { width: 88px; height: 67px; position: absolute; top: 200px; left: 500px; border: 1px solid black; visibility: hidden; } #nav a:hover img { visibility:visible; } </style> <div id="nav"> <ul> <li><a href="#">Link1<img src="camera.jpg" alt="" /></a> <li><a href="#">Link2<<img src="home.png" alt="" /></a></li> <li><a href="#">Link3<<img src="camera.jpg" alt="" /></a></li> <li><a href="#">Link4<<img src="johnpotter.jpg" alt="" /></a></li> </ul> </div> |
|
#2
|
||||
|
||||
|
Change a couple of things...
Hi,
Try changing your BODY section with this: Code:
<body> <div id="nav"> <ul> <li><a href="#"><img src="camera.jpg" alt="">Some text #1</a></li> <li><a href="#"><img src="home.png" alt="">Some text #2</a></li> <li><a href="#"><img src="camera.jpg" alt="">Some text #3</a></li> </ul> </div> </body> I'm quite sure it will work. ![]() |
|
#3
|
|||
|
|||
|
Thanks, but how do i replace the text with images? I put in a normal image tag, but it stops it all from working.
|
|
#4
|
||||
|
||||
|
toolman,
do you want it in a first stage to replace IMG with TEXT, and in another to do the inverse? ... or do you just simply want to display IMG instead of TEXT? |
|
#5
|
|||
|
|||
|
Hi, i just want to display img instead of text... so there's no text at all.
Quote:
Last edited by toolman : February 7th, 2004 at 06:12 AM. |
|
#6
|
||||
|
||||
|
Ok then, try this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div id="nav"> <ul> <li><a href="#"><img src="camera.jpg" alt="" /></a> <li><a href="#"><img src="home.png" alt="" /></a></li> <li><a href="#"><img src="camera.jpg" alt="" /></a></li> <li><a href="#"><img src="johnpotter.jpg" alt="" /></a></li> </ul> </div> </body> </html> After you've tried it, Hit me back. ![]() |
|
#7
|
|||
|
|||
|
Hi,
Thanks for that! I'm also using this script aswell, but i want the second image to appear somewhere else on the page. How would i do that? <style type='text/css'> a.rollover{background-image:url('arrow_hover.png'); width:20px; height:20px;} a.rollover:hover{background-image:url('home.gif'); width:20px; height:20px;} </style> <a class='rollover' href='#'></a> |
|
#8
|
||||
|
||||
|
Sorry for taking all this time but I had to have some sleep.
I've only just seen your reply and I think that you'll be okay with something like this: Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<style type='text/css'>
#rollover
{
width: 88px;
height: 67px;
position: absolute;
top: 200px;
left: 500px;
visibility: hidden;
}
</style>
<div id="rollover"><img src="whatever.jpg" alt=""></div>
<div id="nav">
<ul>
<li><a href="#"><img src="camera.jpg" alt="" onMouseOver="document.all.rollover.style.visibility='visible';" onMouseOut="document.all.rollover.style.visibility='hidden';"></a>
<li><a href="#"><img src="home.png" alt="" onMouseOver="document.all.rollover.style.visibility='visible';" onMouseOut="document.all.rollover.style.visibility='hidden';"></a></li>
<li><a href="#"><img src="camera.jpg" alt="" onMouseOver="document.all.rollover.style.visibility='visible';" onMouseOut="document.all.rollover.style.visibility='hidden';"></a></li>
<li><a href="#"><img src="johnpotter.jpg" alt="" onMouseOver="document.all.rollover.style.visibility='visible';" onMouseOut="document.all.rollover.style.visibility='hidden';"></a></li>
</ul>
</div>
</body>
</html>
How about that? Does it work fine? ![]() |
|
#9
|
|||
|
|||
|
Thanks! That's exactly what I was looking for
![]() |
|
#10
|
||||
|
||||
|
I am glad I was helpful.
Cheers, |
|
#11
|
|||
|
|||
|
Hi,
With the script, people say its not working in NS4 or Mozilla. Is it possible to make it work in all browsers? Quote:
|
|
#12
|
||||
|
||||
|
Hi
ok then, download the attached HTML file, render it and tell me how it behaves -- I've not tried it out. ![]() |
|
#13
|
|||
|
|||
|
Thanks, but the files blank - not source code or anything
|
|
#14
|
||||
|
||||
|
What?!! It's this stupid Windows of mine... been behaving strangely lately!
Right then, hope this works out now. ![]() |
|
#15
|
|||
|
|||
|
Thanks... the file works, but theres no imagaes appearing on the mouseover.. also a error on line 85, char 1 which i cant seem to find.
|