473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using hover-images on <A> different on Firefox and IE

Hi all,

I'm using the following code in my website, and it's looking totally
different on IE and Firefox. It actually works on IE while Firefox is
weird.

In CSS:
img.left_nav_1 {background: transparent;}
a.left_nav_1 { background : url(/images/rollovers_01.gif);}
a.left_nav_1:hover {background : url(/images/rollovers_01-over.gif);}

And in Code:
<a href="/test.cfm" class="left_nav_1">
<img class="left_nav_1" src="/images/Rollovers_trans.gif"
border="0"/></a>

To see this in action check out --
http://tinyurl.com/9v9of in both Firefox and IE.

In Firefox it's like the image is moved down 50%.

Ideas ??? We're already using OnMouseOver javascript tags for our
slide-out menus, so I can't use this with a hoverover script with
javascript... unless someone knows how to do two OnMouseOver commands
within a single anchor tag. I did try this, and both IE and Firefox
only execute the first onMouseOver and ignore the rest.

Suggestions ???

Thanks.

Sam

Jul 21 '05 #1
3 5293
Els
Alex wrote:
Hi all,
Hello
http://tinyurl.com/9v9of in both Firefox and IE. In Firefox it's like the image is moved down 50%. Suggestions ???
You should set the background images on the image, not on the <a>
element. The <a> element is only one letter high.

IE does it wrong btw, because your doctype (or rather, the lack of a
doctype declartion) throws IE into quirksmode.

So, instead of
a.left_nav_1 {
background : url(/images/rollovers_01.gif);
}
a.left_nav_1:hover {
background : url(/images/rollovers_01-over.gif);
}
you write
a.left_nav_1 img {
background : url(/images/rollovers_01.gif);
}
a.left_nav_1:hover img {
background : url(/images/rollovers_01-over.gif);
}
Thanks.


You're welcome :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Carly Simon - You're So Vain
Jul 21 '05 #2
Hi Els,

That did fix it on Firefox -- thanks :) But I'm now testing it on
Safari on OSX and with the added 'img' text to the CSS it's still doing
what Firefox was doing... only showing half the image.

If it's working on Firefox and IE I can write some logic code to show
static buttons for these users, but it'd be nice for the hover-overs to
work on Safari too.

Thanks again for your input --

Sam

Jul 21 '05 #3
Els
Alex wrote:
Hi Els,

That did fix it on Firefox -- thanks :) But I'm now testing it on
Safari on OSX and with the added 'img' text to the CSS it's still doing
what Firefox was doing... only showing half the image.
Okay, I don't have a Mac, so I can't test this, but another option is
to set display:block; to the <a> element, and define it's width and
height. Also, the border of the image may get in the way, so better to
take the border off the image, and put in on the <a> instead.

CSS would become like this:

a.left_nav_1{
display:block;
height:40px;
width:139px;
border:1px solid blue;
}
a.left_nav_1 img{
border:none;
}
a.left_nav_1{
background-image:url(Hillcrest-rollovers_01.gif);
}
a.left_nav_1:hover{
background-image:url(Hillcrest-rollovers_01-over.gif);
}
If it's working on Firefox and IE I can write some logic code to show
static buttons for these users, but it'd be nice for the hover-overs to
work on Safari too.


Of course :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Eagles - Heartache Tonight
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: J. Muenchbourg | last post by:
I'm using replace function to strip 0s from a particular string: <%=replace(rs1("racelength"),"0","''"%> but I need to also strip empty spaces from the string in question. This doesn't work :...
0
by: tonyz.wrightz | last post by:
Hi, Re-describing a problem I'm still having: I have built an installer for my web site. The site where I am working appears to have two web sites operating in IIS. I don't quite know how...
4
by: troloo | last post by:
Hello, I hope you can help me :)) The story goes as follows: I have a class with different methods and member variables. I store pointers to objects of this class inside a vector. Now, I would like...
2
by: okaminer | last post by:
I writing VB.NET Code using Acrobat 6 API functions and my problem is with the following code: _formApp = New AFORMAUTLib.AFormAppClass _acroForm = _formApp.Fields The problem is that when I...
4
by: AB | last post by:
Hi All, I would like to add controls that stored in DB dynamically, and I don't know their names or their number. The names of the controls is important therefore I can't create cmbArr(0),...
0
by: neeteshbhatiaalld | last post by:
Hi all Well my problem is i have created a active x control its ocx and registered it successfully. Now when i m inserting it in my web page (index.htm) i want to pass values to that activex...
12
realin
by: realin | last post by:
hi guys, I have a php file say "class.php" in which a database class is defined. I have got another file namely "config.php" which initializes its object as require_once("class.php");...
3
reginaldmerritt
by: reginaldmerritt | last post by:
I'm using Dlookup to search a table for the first record it comes across that has a date >= the date i specifiy. e.g. formateddate = format(Me.SelectedDate,"mmddyy") VarX = DLookup("",...
1
by: maheshgupta024 | last post by:
Im very new to PHP, and interseted in network stuff, using php can i enter into different computers from network within my LAN. Can anyone help on this.. Thanks in Advance
5
by: Christopher Brewster | last post by:
I am running the same script on the same data on two different machines (the folder is synchronised with Dropbox). I get two different results. All the script does is count words in different...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.