Activity Stream
48,167 MEMBERS
63910 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1.     
    #1
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com

    Default CSS - Sprites (Web 3.0) Tutorial

    Heya all,

    ive been redesigning litewarez over the lsat few weeks and ive started to implement a new feature with css called sprites.

    What it does:

    Basically what you do is create on image containing more than one image then using css you will select the location of a particular image within your main image

    this way you can have all your images with just one request this saves alot of bandwidth and speed for your users.

    Heres an example of of what the image looks like HERE

    here is an example of me using sprite for my download icons

    Code: 
    /*This will load the image into the class name sprite_dlIcons*/
    .sprite_dlIcons{background:url('../images/sprite_icons.png');}
    			
    /*Icons*/
    	/*This will set the width of every icon*/
    	.Icon{width:16px;}
    		
    		/*This is individual classes for each ic.. and there positions*/
    		.tv{ height:16px; background-position:-0px -0px;}
    		.template{ height:16px; background-position:-0px -16px;}
    		.xxx{ height:16px; background-position:-0px -30px;}
    		.other{ height:16px; background-position:-0px -46px;}
    		.music{ height:16px; background-position:-0px -63px;}
    		.movie{ height:16px; background-position:-0px -80px;}
    		.game{ height:16px; background-position:-0px -98px;}
    		.ebook{ height:16px; background-position:-0px -112px;}
    		.app{ height:16px; background-position:-0px -130px;}
    Here is the image that's used for the sprite

    Ok so now the html for the icons

    Code: 
    <div class="sprite_dlIcons Icon tv"></div>
    <div class="sprite_dlIcons Icon game"></div>
    <div class="sprite_dlIcons Icon ebook"></div>
    <div class="sprite_dlIcons Icon app"></div>
    now as you can see were setting multiple classes for the div.

    the first to are going to be be loaded for all divs using the sprite and the last one is dynamic because they are select different pixal locations for the icons

    if you wish to follow this up any further there;s plenty of information on Google
    hope you enjoy my tip.

    Helpfull Links:
    Sprite Generator : Provided By -=MOD=-
    litewarez Reviewed by litewarez on . CSS - Sprites (Web 3.0) Tutorial Heya all, ive been redesigning litewarez over the lsat few weeks and ive started to implement a new feature with css called sprites. What it does: Basically what you do is create on image containing more than one image then using css you will select the location of a particular image within your main image this way you can have all your images with just one request this saves alot of bandwidth and speed for your users. Rating: 5
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Website's:
    X4B.org
    phpbb3 uses the same technique to acheive flickerless rollovers.

  4.     
    #3
    Member
    Website's:
    WareztheDDL.com GTFO.ws
    this only downfall would be when creating new aimages, to add to that image lol. other then that nice tut.
    i use the rollover and the possition for my navbar

  5.     
    #4
    Member
    Website's:
    Plutost.com OffshorePort.net Desi-Mobilez.com PhotoshopDesigner.co.uk TutsBy.me BabesWallpapers.net
    Coool ! Nice Tutorial mate !
    Plutost.com Asia & Europe Hosting Provider / Offshore Shared/VPS Hosting / Even Better than Gold
    WHMCS License Verify (Catch those scam hosts)
    Tutorials By .Me

  6.     
    #5
    Member
    Website's:
    maxedoutdesigns.com
    Nice tutorial i didn't know what you was on about before but now i do! i may try this one time
    What do i do?
    vBulletin Skins,Custom CMS Designs,Wordpress Designs
    and much more!
    Thread :: Website

  7.     
    #6
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Rollover can be used with sprites aswell.

    heres the visual way to help you understand what pixals do what...

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  8.     
    #7
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    the first css block is the width of all your images unless they vary you can place them within the individual css icon blocks so if you want to got H instead of V you will do summat like this

    Code: 
    
    .Icons{width:20px;} // will set the width of each button to 20px;
    //  |__20px__||__20px__||__20px__||__20px__|
    // so by having for icons in a sprite that would mean the image is 4x20 = 80px wide
    
    //Then you would change the individuals so do the following
    .tv{ height:30px; background-position:-0px -0px;} //iamge 1
    .app{ height:30px; background-position:-20px -0px;} // image 2
    
    //what this does is sets the hight of the image to 30px and the first background-position is how many pixals from the left you want the image to start so and so on
    hope this help you
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  9.     
    #8
    Member
    Coding Horror Fan
    I don't read PM's frequently .

  10.     
    #9
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Thanks @ -=MOD=- wil update post with that helpfull link!
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  11.     
    #10
    Banned
    This will work for different heights right?

    If i do it like this

    .ebook{ height:200px; background-position:-0px -112px;}

    .app{ height: 200px; background-position:-0px -214px;}

    ?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Social Network Icons in form of CSS Sprites for websites
    By flanker in forum Web Development Area
    Replies: 1
    Last Post: 15th Jun 2012, 06:19 AM
  2. [Hiring] Combine images using CSS sprites
    By chakravarti in forum Completed Transactions
    Replies: 8
    Last Post: 14th Apr 2011, 05:05 AM
  3. MP5 tutorial?
    By Divvy in forum Webmaster Discussion
    Replies: 10
    Last Post: 12th Apr 2011, 11:43 PM
  4. CSS Sprites Help
    By BlaZe in forum Web Development Area
    Replies: 8
    Last Post: 16th Feb 2011, 08:45 AM
  5. [html/css] Mouse Hover Button using Sprites
    By jayfella in forum Web Development Area
    Replies: 6
    Last Post: 15th Jun 2010, 11:21 AM

Tags for this Thread

BE SOCIAL