Wordpress css hover

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
Hi

Sharing a tip for developers :)

I am using sprite images and when I hover it just use the bottom part of the image. This is very handy to speed up your website or blog.

CSS:

#ID {
width: 136px; //SIZE OF THE ONE PART OF THE IMAGE
height: 48px;
background-image: url("THE-IMAGE");
background-position: top; //TOP PART OF IMAGE
display: block; //MAKE THE IMAGE A LINK
}

#ID:hover {
background-position: bottom; //BOTTOM PART OF THE IMAGE
}

HTML:
<a id='ID' href="http://LINK"> </a>
 
Older threads
Replies
8
Views
3,747
Replies
1
Views
2,472
Replies
1
Views
2,426
Replies
1
Views
2,287
Replies
5
Views
2,475
Newer threads
Replies
0
Views
2,356
Replies
0
Views
2,558
Replies
6
Views
4,495
Replies
6
Views
3,747
Replies
4
Views
3,358
Latest threads
Replies
0
Views
29
Replies
0
Views
32
Replies
1
Views
41
Replies
3
Views
106
Top