|
Post by Reverse Blade on Nov 8, 2007 21:33:49 GMT -5
The Css is like this: <style> .nav a:link { background-image: url(promotion.jpg); background-position: 0px; } .nav a:hover { background-image: url(promotion.jpg); background-position: 50px; } </style>
It gives the link a background and positions it to 0px on the image, then on hover it moves the image 50px. Try it to see with your own image to make easy rollovers, it only takes one image. To make the next not look like a link just use text-decoration: none;
|
|
Blink
Addicted Member
Posts: 1,699
|
Post by Blink on Nov 8, 2007 22:58:01 GMT -5
The Css is like this: <style> .nav a:link { background-image: url(promotion.jpg); background-position: 0px; } .nav a:hover { background-image: url(promotion.jpg); background-position: 50px; } </style>
It gives the link a background and positions it to 0px on the image, then on hover it moves the image 50px. Try it to see with your own image to make easy rollovers, it only takes one image. To make the next not look like a link just use text-decoration: none; it still needs to load the image though... Regardless that's cool. had no idea that would work.
|
|
Kahless
Administrator
Guitar Star
Posts: 1,045
|
Post by Kahless on Nov 8, 2007 23:15:11 GMT -5
ah yeah, makes sense, Though it would remove the drag of loading the image, its still the same total size
|
|
|
Post by Reverse Blade on Nov 9, 2007 1:03:55 GMT -5
Eh, it makes it smoother
|
|
|
Post by Tobias on Nov 10, 2007 14:11:55 GMT -5
I've seen that before. I always forget to use it, though. ;D
|
|
Stinky666
Addicted Member
PSP is #1 Forever!
Posts: 1,202
|
Post by Stinky666 on Nov 12, 2007 1:13:23 GMT -5
Makes 100% no sense to me, but thanks lol
|
|
Chad
Senior Member
Former Staff
Posts: 396
|
Post by Chad on Nov 12, 2007 11:27:38 GMT -5
haha Stinky. Lern2CSS. My rollovers are somewhat like this.
|
|
Blink
Addicted Member
Posts: 1,699
|
Post by Blink on Nov 12, 2007 22:28:27 GMT -5
I think what it does it load it on page load because it recognizes it as a background.
Why not just use a preloader js code?
|
|
|
Post by Tobias on Nov 13, 2007 5:46:55 GMT -5
Because JS is slower than CSS, and this way it only has to load one image, although it is just twice as big as one of the two that you would need if you had them seperately. No ugly pause while it downloads the new image during the hover.
|
|
Kahless
Administrator
Guitar Star
Posts: 1,045
|
Post by Kahless on Nov 13, 2007 15:44:18 GMT -5
CSS loads approximatly 4x faster then JS from what Ive read
|
|
Blink
Addicted Member
Posts: 1,699
|
Post by Blink on Nov 13, 2007 17:10:56 GMT -5
CSS loads approximately 4x faster then JS from what Ive read CSS is approximately 4x gayer then JS. But o.k, you win. This code rocks my sox and I'll use it on my next website
|
|
Kahless
Administrator
Guitar Star
Posts: 1,045
|
Post by Kahless on Nov 13, 2007 17:36:36 GMT -5
CSS is more useful on PBs then JS, really
|
|