Wordpress css hover

jdunhin

Active member
Registered
Joined
Feb 27, 2013
Messages
72
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
Newer Threads
Replies
0
Views
2,450
Replies
0
Views
2,596
Replies
3
Views
3,016
Replies
1
Views
2,267
Recommended Threads
Replies
3
Views
2,308
Replies
21
Views
9,165
Replies
10
Views
4,929
Replies
2
Views
2,302

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

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