| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
|
CSS image overlay
i just stumped myself... if you go to http://www.kdwebserver.co.uk/~peartr...tree-sales.htm you'll see the images of the cameras at the bottom have a little green arrow (its part of the image). What I want to do is create two graphics containing that arrow graphic (over and normal state) and then overlay the small arrow graphics using css on the actual graphic (which will save on download times) i cant use background image for the a tag as obviously that will be hidden behind the graphic, im stuck, so please help |
|
|
|
|
|
#2 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
|
actually, figured it out myself: Code:
|
|
|
|
#3 (permalink) |
|
i'm done, son
Join Date: Jan 2005
Posts: 12,262
|
The images are 5K...why not just do a rollover? As in... <a href="#">Some Camera</a> Use image replacement to get rid of the text, set the <a> as a block the size of the image, use a double sized image (both states in one image), on hover change the background-position. Problem solved with less markup and better accessibility. |
|
|
|
#4 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
|
that method means that for each image it has to be made twice.. they may only be 5kb, but if you have 15 on a page: 5k x 15 = 75kb 75k * 2 = 150kb this method ive just made now only comes to 5k * 15kb = 75kb 2kb total for mouseover graphics 77kb total.... and as the number of products continues to increase the size differences will start to become more noticeable - plus it will save time on the graphic creation side |
|
|
|
#5 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
|
hrm, it works in FF but not IE.. any suggestions? http://www.kdwebserver.co.uk/~peartr...tree-sales.htm |
|
|
|
#7 (permalink) |
|
dt immigrant
|
Try using this script changing bg img on hover in a div... |
|
|
|
#10 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
|
got another problem with IE on this site, if you go to http://www.kdwebserver.co.uk/~peartr...ment-cambo.htm the first grey box shows correctly, but the second one has all the text squished up (its just a copy and paste of the one above with different content, if i delete the first one the second one shows properly) |
|
|
|
#15 (permalink) | |
|
dt immigrant
|
You have spans around uls. I think that's what's causing you the problem Check the W3C validator, error 6 Quote:
Way too many divs for a simple layout, IMHO. Anyway, this seems to fix the problem. (If you reverse the order of the .inner divs you'll see the same thing happens to the one coming after the first, so that's why I suspect the spans.) Code:
|
|
|
![]() |