I'll start by saying I almost have no idea what I'm doing. I'm extremely new to CSS and everything I do know I've taught myself by googling and reading through others' codes.
What I'm trying to accomplish is a rollover image swap map without the use of java, as the site Im using it on does not allow java.
I've looked all over and haven't been able to find one without java, so now I'm here. x.x
I have CSS for an image map so I guess my question is, is there a property I can input to define the a:hover bg image location so I can move it up and to the left from its original location to fully overlay the current visible image? Or is there some other method to accomplish this? Or maybe its just not possible at all? :s
I believe your trying to create a set of images that when the user rolls their mouse over each image, a different image appears. If this is true, you will want to look at an image sprite and use x/y coordinates to find the part of the image to look at for each state.
a{
background: ('path/to/sprite.gif') no-repeat 0 0 scroll transparent;/*this gives the basic definition of the sprite and tells it to not-repeat inside the container, 0 0 is x y coords but listed as distance from left and top corner. transparent can be used to have no color in the box behind the image or a color can be used here*/
height: 20px;/*this makes the a tag show everything in 20px or less high*/
width: 20px; /*this makes the a tag show everything in 20px or less wide*/
}
a:hover{/*this creates a hover state for the a tag*/
background-position: 0 -120px;/*this uses the background image from the original a{} above but tells the browser to look at new coordinates*/
}
If you have access to photoshop, it will help out greatly since you can use guides to see the position.
Bookmarks