CSS Sprite Technique

CSS-

<style>
    a.traffic {
        display: block;
        height: 50px;
        overflow: hidden;
        position: relative;
        width: 50px;
    }

    a.traffic span {
        background: url('TrafficSprite.png') no-repeat;
        display: block;
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
    }

    a.traffic:hover span {
        background-position:  -48px 0;
    } 

</style>

HTML-

 <a class="traffic" href=""><span></span></a>

Here is the sample image-
TrafficSprite

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s