CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 10th, 2003, 12:11 PM
Chris Sansom Chris Sansom is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London, UK
Posts: 20 Chris Sansom User rank is Lance Corporal (50 - 100 Reputation Level)Chris Sansom User rank is Lance Corporal (50 - 100 Reputation Level)Chris Sansom User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 h 18 m 41 sec
Reputation Power: 0
CSS change of background link (longish)

In an attempt to be well behaved and use CSS in as full a way as possible, I thought I'd try a nifty trick to get away from sliced images. I have a background image with some image links superimposed on it, which should change when rolled over. My nifty trick (I thought) was to place a transparent gif in a <div>, wrapped in an <a> and define the div with the background as the image I want for the link, like so:

div#index {
position: absolute;
top: 25px;
left: 23px;
background: transparent url(index.gif) no-repeat;
}

That much works beautifully, and the page background image shows through just as I hoped. So the next stage is the rollover, which I've done like this:

div#index a:hover {
background: transparent url(index-over.gif) no-repeat;
}

And that's where I come partly unstuck. To my surprise, IE seems to be the browser that behaves as I expect: both 5.2 in Mac OS X (my main platform) and 5.5 in Windows (I don't have immediate access to v.6). However, in Gecko-based browsers (eg Camino and Netscape 7) and Apple's Safari, it almost works but not quite: the rollover image is offset downwards by about 3 or 4 pixels and I can't for the life of me firgure out why! Horizontally it's correct, just down a bit vertically.

Given that IE is usually the baddie in these circumstances, I can't help feeling I have actually done something wrong, which IE happens to accomodate, but I've checked everything I can think of (eg that the two images are exactly the same dimensions, there's nothing else in the style sheet that might affect it, etc.) and come up blank.

Any clues, anyone?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS change of background link (longish)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway