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,190
Replies
1
Views
2,022
Replies
1
Views
1,973
Replies
1
Views
1,843
Replies
5
Views
1,945
Newer threads
Replies
0
Views
1,942
Replies
0
Views
2,156
Replies
6
Views
3,915
Replies
6
Views
3,168
Replies
4
Views
2,830
Latest threads
Replies
0
Views
94
Replies
3
Views
112
Replies
1
Views
95
Recommended threads
Replies
0
Views
1,369
Replies
47
Views
6,881
Replies
0
Views
1,094
Replies
7
Views
1,953
Replies
3
Views
2,856

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top