Results 1 to 10 of 15
-
9th May 2009, 04:00 AM #1OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comCSS - 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;}
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>
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: 5Join 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
-
9th May 2009, 04:32 AM #2Respected DeveloperWebsite's:
X4B.org
-
9th May 2009, 04:40 AM #3MemberWebsite's:
WareztheDDL.com GTFO.wsthis 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
-
9th May 2009, 07:44 AM #4MemberWebsite's:
Plutost.com OffshorePort.net Desi-Mobilez.com PhotoshopDesigner.co.uk TutsBy.me BabesWallpapers.netCoool ! 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
-
9th May 2009, 10:58 AM #5MemberWebsite's:
maxedoutdesigns.com
-
9th May 2009, 10:59 AM #6OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comRollover 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
-
28th May 2009, 10:04 AM #7OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comthe 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
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
-
28th May 2009, 04:12 PM #8Member
this may be helpful
http://spritegen.website-performance.org/Coding Horror Fan
I don't read PM's frequently .
-
28th May 2009, 04:26 PM #9OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comThanks @ -=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
-
28th May 2009, 05:06 PM #10Banned
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;}
?
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Social Network Icons in form of CSS Sprites for websites
By flanker in forum Web Development AreaReplies: 1Last Post: 15th Jun 2012, 06:19 AM -
[Hiring] Combine images using CSS sprites
By chakravarti in forum Completed TransactionsReplies: 8Last Post: 14th Apr 2011, 05:05 AM -
MP5 tutorial?
By Divvy in forum Webmaster DiscussionReplies: 10Last Post: 12th Apr 2011, 11:43 PM -
CSS Sprites Help
By BlaZe in forum Web Development AreaReplies: 8Last Post: 16th Feb 2011, 08:45 AM -
[html/css] Mouse Hover Button using Sprites
By jayfella in forum Web Development AreaReplies: 6Last Post: 15th Jun 2010, 11:21 AM
themaCreator - create posts from...
Version 3.57 released. Open older version (or...