472,986 Members | 3,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 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 5278
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 vo. 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 vo. 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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.