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

Results 1 to 9 of 9
  1.     
    #1
    Too busy :|
    Website's:
    L337Fx.com BeastieBay.net

    Default CSS Sprites Help

    Alright, so I'm new in CSS. I was trying to reduce the number of HTTP Requests on RapidScene.ws by minimizing all the icons to CSS sprites and load them via one image. Currently I'm trying this out on the category icons.

    This is the CSS which I made with the help of tutorials.

    style.css
    PHP Code: 
    /* CSS Sprites By BlaZe */

    /* Key to #nav classes
    li.soft = Software
    li.game = Games
    li.mov = Movies
    li.mus = Music
    li.tv = TV Shows
    li.gfx = Graphics
    li.eb = eBooks
    li.temp = Templates
    li.script = Scripts
    li.ps = Photoshop Resources
    li.tut = Tutorials
    li.xxx = Adult */

    #cat li.soft,
    #cat li.game,
    #cat li.mov,
    #cat li.mus,
    #cat li.tv,
    #cat li.gfx,
    #cat li.eb,
    #cat li.temp,
    #cat li.script,
    #cat li.ps,
    #cat li.tut,
    #cat li.xxx{
    background:url('/custom/icon_sprites.png'no-repeat;
    padding:0 0 0 19px;
    }

    /* Positioning */
    li.soft {
    background-position:0 0px;
    padding-top:2px;
    }
    li.game {
    background-position:-17px;
    padding-top:2px;
    }
    li.mov {
    background-position:-34px;
    padding-top:2px;
    }
    li.mus {
    background-position:-51px;
    padding-top:2px;
    }
    li.tv {
    background-position:-68px;
    padding-top:2px;
    }
    li.gfx{
    background-position:-85px;
    padding-top:2px;
    }
    li.eb {
    background-position:-102px;
    padding-top:2px;
    }
    li.temp {
    background-position:-119px;
    padding-top:2px;
    }
    li.script {
    background-position:-136px;
    padding-top:2px;
    }
    li.ps {
    background-position:-153px;
    padding-top:2px;
    }
    li.tut {
    background-position:-170px;
    padding-top:2px;
    }
    li.xxx {
    background-position:-187px;
    padding-top:2px;
    }

    /* Again (litewarez tutorial) */

    .sprite{background:url('/custom/icon_sprites.png');}
    .
    icon{width:16px;}

    .
    soft{height:17pxbackground-position:-0px -0pxpadding-left:18px;}
    .
    game{height:17pxbackground-position:-0px -17pxpadding-left:18px;}
    .
    mov{height:17pxbackground-position:-0px -34px;}
    .
    mus{height:17pxbackground-position:-0px -51px;}
    .
    tv{height:17pxbackground-position:-0px -68px;}
    .
    gfx{height:17pxbackground-position:-0px -85px;}
    .
    eb{height:17pxbackground-position:-0px -102px;}
    .
    temp{height:17pxbackground-position:-0px -119px;}
    .
    script{height:17pxbackground-position:-0px -136px;}
    .
    ps{height:17pxbackground-position:-0px -153px;}
    .
    tut{height:17pxbackground-position:-0px -170px;}
    .
    xxx{height:17pxbackground-position:-0px -187px;} 
    Displaying them :
    PHP Code: 
    <div class="sprite icon soft" /><a href="/softwares">Softwares</a></div>
    <
    div class="sprite icon game" /><a href="/games">Games</a></div
    Output :


    So how do I fix it ?
    BlaZe Reviewed by BlaZe on . CSS Sprites Help Alright, so I'm new in CSS. I was trying to reduce the number of HTTP Requests on RapidScene.ws by minimizing all the icons to CSS sprites and load them via one image. Currently I'm trying this out on the category icons. This is the CSS which I made with the help of tutorials. style.css /* CSS Sprites By BlaZe */ /* Key to #nav classes li.soft = Software li.game = Games Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    margin-right?

  4.     
    #3
    Too busy :|
    Website's:
    L337Fx.com BeastieBay.net
    @edavreda,

    Show me an example please ? I'm new to CSS :\

  5.     
    #4
    Member
    Website's:
    PasteBot.appspot.com
    Do this
    Code: 
    /* Again (litewarez tutorial) */
    
    .sprite{background:url('/custom/icon_sprites.png') no-repeat;}
    Just add the no-repeat

  6.     
    #5
    Too busy :|
    Website's:
    L337Fx.com BeastieBay.net
    Thanks ajinkya9

    ===========

    I added no-repeat and this is what I'm getting



    style.css
    PHP Code: 
    /* CSS Sprites By BlaZe */

    /* Key to #nav classes
    li.soft = Software
    li.game = Games
    li.mov = Movies
    li.mus = Music
    li.tv = TV Shows
    li.gfx = Graphics
    li.eb = eBooks
    li.temp = Templates
    li.script = Scripts
    li.ps = Photoshop Resources
    li.tut = Tutorials
    li.xxx = Adult */

    .sprite{background:url('/custom/icon_sprites.png'no-repeat;}
    .
    icon{width:16px;}

    .
    soft{height:17pxbackground-position:-0px -0pxpadding-left:18px;}
    .
    game{height:17pxbackground-position:-0px -17pxpadding-left:18px;}
    .
    mov{height:17pxbackground-position:-0px -34pxpadding-left:18px;}
    .
    mus{height:17pxbackground-position:-0px -51pxpadding-left:18px;}
    .
    tv{height:17pxbackground-position:-0px -68pxpadding-left:18px;}
    .
    gfx{height:17pxbackground-position:-0px -85pxpadding-left:18px;}
    .
    eb{height:17pxbackground-position:-0px -102pxpadding-left:18px;}
    .
    temp{height:17pxbackground-position:-0px -119pxpadding-left:18px;}
    .
    script{height:17pxbackground-position:-0px -136pxpadding-left:18px;}
    .
    ps{height:17pxbackground-position:-0px -153pxpadding-left:18px;}
    .
    tut{height:17pxbackground-position:-0px -170pxpadding-left:18px;}
    .
    xxx{height:17pxbackground-position:-0px -187pxpadding-left:18px;} 
    On main page
    PHP Code: 
    <div class="sprite icon soft" /><a href="/softwares" title="Download Windows & Macintosh Applications"/>Softwares</a></div>
                                    <
    div class="sprite icon game" /><a href="/games" title="Download PC, Console & ROM Games"/>Games</a></div>
                                    <
    div class="sprite icon mov" /><a href="/movies" title="Download Latest Movies XViD, DVDR, CAM"/>Movies</a></div>
                                    <
    div class="sprite icon mus" /><a href="/music" title="Download Music, Videos & Albums"/>Music</a></div>
                                    <
    div class="sprite icon tv" /><a href="/tv-shows" title="Download Latest TV Show Seasons"/>TV Shows</a></div>
                                    <
    div class="sprite icon gfx" /><a href="/graphics" title="Download Graphic Resources"/>Graphics</a></div>
                                    <
    div class="sprite icon eb" /><a href="/ebooks" title="Download eBooks, Guides & Tutorials"/>eBooks</a></div>
                                    <
    div class="sprite icon temp" /><a href="/templates" title="Download Joomla, Wordpress, Forum Templates"/>Templates</a></div>
                                    <
    div class="sprite icon script" /><a href="/scripts" title="Download latest rare scripts"/>Scripts</a></div>
                                    <
    div class="sprite icon ps" /><a href="/photoshop-resource" title="Download Adobe Photoshop Plugins, Brushes, Patterns & Shapes"/>Photoshop Resource</a></div>
                                    <
    div class="sprite icon tut" /><a href="/tutorials" title="Download Video Tutorials & Demonstrations"/>Tutorials</a></div>
                                    <
    div class="sprite icon xxx" /><a href="/adult-xxx" title="Download XXX Porn Videos, Clips, Moves, Siterips"/>Adult XXX (+18)</a></div

  7.     
    #6
    Member
    here you goo mate

    remove the icon class from css file or increase the width
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  8.     
    #7
    Member
    Website's:
    PasteBot.appspot.com
    Replace the php Code on the Main Page with this:

    PHP Code: 
    <div class="sprite icon soft" /><a href="/softwares" title="Download Windows & Macintosh Applications"/>Softwares</a></div>
                                    <
    div class="sprite icon game" /><a href="/games" title="Download PC, Console & ROM Games"/>Games</a></div>
                                    <
    div class="sprite icon mov" /><a href="/movies" title="Download Latest Movies XViD, DVDR, CAM"/>Movies</a></div>
                                    <
    div class="sprite icon mus" /><a href="/music" title="Download Music, Videos & Albums"/>Music</a></div>
                                    <
    div class="sprite icon tv" /><a href="/tv-shows" title="Download Latest TV Show Seasons"/>TV&nbsp;Shows</a></div>
                                    <
    div class="sprite icon gfx" /><a href="/graphics" title="Download Graphic Resources"/>Graphics</a></div>
                                    <
    div class="sprite icon eb" /><a href="/ebooks" title="Download eBooks, Guides & Tutorials"/>eBooks</a></div>
                                    <
    div class="sprite icon temp" /><a href="/templates" title="Download Joomla, Wordpress, Forum Templates"/>Templates</a></div>
                                    <
    div class="sprite icon script" /><a href="/scripts" title="Download latest rare scripts"/>Scripts</a></div>
                                    <
    div class="sprite icon ps" /><a href="/photoshop-resource" title="Download Adobe Photoshop Plugins, Brushes, Patterns & Shapes"/>Photoshop&nbsp;Resource</a></div>
                                    <
    div class="sprite icon tut" /><a href="/tutorials" title="Download Video Tutorials & Demonstrations"/>Tutorials</a></div>
                                    <
    div class="sprite icon xxx" /><a href="/adult-xxx" title="Download XXX Porn Videos, Clips, Moves, Siterips"/>Adult&nbsp;XXX&nbsp;(+18)</a></div
    I Just Replaced all the Spaces with
    Code: 
    &nbsp;

    Alternatively, you can Also Remove the following from style.css
    Code: 
    .icon{width:16px;}

  9.     
    #8
    Too busy :|
    Website's:
    L337Fx.com BeastieBay.net
    @warezrock & ajinkya9,

    It worked ! Thanks ! ya both


  10.     
    #9
    Retired NinJa
    Website's:
    loledhard.com
    this post would be good to learn css sprites

    & ajinkya9, nice to see u helping members



    You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!

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. [html/css] Mouse Hover Button using Sprites
    By jayfella in forum Web Development Area
    Replies: 6
    Last Post: 15th Jun 2010, 11:21 AM
  4. CSS - Sprites (Web 3.0) Tutorial
    By litewarez in forum Tutorials and Guides
    Replies: 14
    Last Post: 29th May 2009, 01:01 AM

Tags for this Thread

BE SOCIAL