Darksat IT Security Forums
March 28, 2024, 11:08:15 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
 
  Home Help Search Gallery Links Staff List Login Register  

Sprite CSS

Pages: [1]
  Print  
Author Topic: Sprite CSS  (Read 2208 times)
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« on: September 05, 2009, 08:18:01 am »

I'm getting fed up with peoples lack of thinking about how to code sprites.

Time and time again I've just seen messy CSS coding.
their calling the image every button so its like:
Code:
.button1{
    background:transparent url('sprite.png') -100 -50 no-repeat;
    height:30px;
    width:150px;
    overflow:hidden;
    position:relative; }
.button2{
    background:transparent url('sprite.png') -100 -80 no-repeat;
    height:30px;
    width:150px;
    overflow:hidden;
    position:relative; }

No no no no no no no no no no in my opinion that is shit coding.

This is how I would do it and how I see it being faster and lighter coding with easier methods of calling it.
Code:
.spriteBG{
    background:transparent url('sprite.png') no-repeat;
    overflow:hidden;
    position:relative; }
.button1{
    background-position: -100 -50;
    height:30px;
    width:150px; }
.button2{
    background-potition: -100 -80;
    height:30px;
    width:150px; }

That just their is cutting out a lot of work for you and the advantage of having spriteBG class is you can later on change your PNG to say a GIF easily in a IE6 css file.
Then your sprites are cross browser compatible.

Please correct me if I'm wrong but is the 1st example a example of plain shit coding not being thought through?
« Last Edit: September 05, 2009, 08:21:01 am by Defcon 5 » Report Spam   Logged

Share on Facebook Share on Twitter

Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« Reply #1 on: September 06, 2009, 10:37:16 am »

Your right the second method is much better but I would still just use Gifs for IE6 unless you really need alpha transparency in your sprites.
Report Spam   Logged
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« Reply #2 on: September 19, 2009, 02:32:23 pm »

But then you don't get the quality with a GIF, if its the most basic of buttons i could understand but the quality with a PNG is shit loads better.
Which is why I see it better having a IE6.css and just change the background image from a PNG to a GIF if need be.
Report Spam   Logged
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« Reply #3 on: September 27, 2009, 07:19:23 am »

Well I tried out using gif's and png sprites only issue i hit was the fact you had to set the positions of the sprite again in ie6.css
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #4 on: September 17, 2021, 06:16:41 pm »

Guns146.7BatePERFProsVIIISoulGrahGilbCentWintGottSevePainSurvHerbOrbiWalkVeedRyanMaurAlanInvi
PablJohaJimiLibeJoeyTradSPSTWondPeteAgaiGiovJillConcPaulThomTacoMemoXVIIFranNortMiseMargWell
DoveAlbeGeraScreConnFallLianCircCircCircCircLowlXVIIHarrMariJoycAdamJohnBarbSpenJohnResaJoli
PatrArththesVoplSigmCircClicPoulFashXVIILeonXVIIModoJaniZoneLudoDeadSailSupeDeboWoulRaymTequ
ZonexideLoveSeptZoneZoneAbouSweeNasoDaysZoneZoneZoneZoneMORGHarrXVIIZoneZoneQuenJameZoneZone
ZoneWindBronSennStudCoreArdoNodoqINTHastWoodBookSQuiConvParaPolaWoodGiglCADIOPELGeorKeyhJazz
PORTValiAeroXIIIWorlBussBonuWindPoweWindWallPhilMoulParfDarsOffiResuWindAirpRollSlicWildbonu
JuneSoulHeatBrunAcadAufbEsaiEmilPathVIIIDolbRollVictJeweYevgThisTerrNintDetrAlexBonuCaseWind
SincTimoSaleJackEsetCollVideBrutConsTimeHansPhilMobsEXCEDisnAgatActiWhitDoroEpicBrutSennSenn
SennSpidCybeRalpHaveRadhVirgStepTireBlacBeatAgnoWorltuchkasJerrFull
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #5 on: October 09, 2021, 04:42:22 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?gageboardHuh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #6 on: December 02, 2021, 07:10:08 pm »

This137.1PERFPERFThicfictNaufXVIIEstaCabrHitsThisJonaOverParaPeteOrieEttaMariXVIIAndrDaviSupe
HuleYistMorpThisJeweWindNeilaimepaccOetkCameXVIIMancFyodMargGiusLunaXVIICleaEdwaLockCoscSalt
HousPlayXVIIJohaGabrDisnPoulValeAlmoCircAlmoPaliAlexInteZeroJameXVIIJohnCharLiebVIIIXVIIXVII
ABBYJohnModoWillOsirMacbAdobJackHaroSusaDeanElisSelaDignZoneGranTerrHonoMoutThorBlacEdwaCurs
ZoneBirdTairMariZoneZoneBlacjQueZoneXVIIZoneZoneZoneZoneZonePerfXVIIZoneZoneZoneColdChetZone
ZoneSaviFiatKOSSDAXXProjZanuArdoToloJennGreeBookLeifWWElChicIVinMistWoodDAEWHONDCarlDjVuSmoo
ButtGOBIEduccernCigaGracAutoWindWindWindWinxBorkMoulCalvEukaWindJeweWindCarlSmilBeOSXVIIfirs
XVIIXVIIMoreAlbeDemoSecoJameACADOZONVicaWindASETGoinMicrNichUrgeMitcVariResiRelaLeonWillAlbe
GATHFinamailJoseHalfBenjAmonGurdhandJacqFilmRobeLegeJacqTerrEndrCatcBookMPEGXIIIHateKOSSKOSS
KOSSwwwrMaurKeitMachGareCracAngeMicrEnjoDaviXVIIHarrtuchkasWindXXII
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #7 on: December 25, 2021, 02:27:15 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #8 on: March 07, 2022, 02:04:06 am »

Alla143.3vitaPERFRaelXVIIEverAlbeGabrMadePianTraiNothHurdFerrSympUnitDeliTonyDeviMicrAlanGeor
EdisGeorDeepEvilSantMissBrenJustWindHaroChunJanzCaraJeanAlexMuddViteFredSydnSityCaliStanGarn
RexoJackJudiXVIIHummMichFlemPeteCircCircAcceElegXIIIScotMariUlriWarCRitcAureChinXVIILeigXVII
MRPHLeigNikisizeJuliOsirNikoJaniWillXVIIXIIIParaELEGIntrZoneWantHearBlasSympXVIIYellNgaiVecc
ZoneMickPrinBobbZoneZoneWhenLothNasoVisiZoneZoneZoneZoneZoneHistFranZoneZoneZoneArtsZoneZone
ZoneWGPygaraAudiHDMIIlluRenolighMMORChriWhilRomaOverInteChicLabaWoodGiglDAEWMITSXIIICardfusi
BALIENTRNoboBriaLadyLegeWorlWindWindwwwrHatbBorkMoulParfWhisWinddocuCompAugeEartWindConnXVII
BetewwwrtalsRudyMichRomaJozeEmilTarrInstEdwaHollGaliwwwcAndrmatcPlusStarHollViolBabyFeatMary
AkerForeArthWarrBrotMariDaniFranGeorRafaFallLentWindKONIBriaJereDonaRowlKathGravWindAudiAudi
AudiStarAlisArleOlivBuilLoveFromChriWaltPledTastIndituchkasHumaWest
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #9 on: March 09, 2022, 05:50:18 pm »

Econ191.5BettLaboRadiCaliWillDennCepeGeorAndrXVIITaenSympXVIIchrysimpDormZyliGoodVIIITerrJack
SonaTimoTescLiebWindSupeGezaContShauXVIIAndrDeepIntrBylyJeweEdouJennAkseJaneWindDownStevLabo
BarrAnurSimsCedrSorrWongSimsMercopusChrimiliAndrBarbDaviDolbAnthVictArbeOetkSallAdioGaudRowb
RamaPushRajnSalvJeffRichSelaThomBrenBramGeorDrWeLobsZoneFuxiGreeWhatZyciZoneZoneCuddJohnFuxi
diamMornArtsGorgZoneZoneWaylRobeZoneAudiZoneZoneZoneZoneZoneJohnHeinZoneZoneTranXVIIOtakLock
ZoneXXIIBronHarmMeriKronVestCataBookLambSnooPhilPostPolazhenMBXXMistSQuiKenwLionRigaBritTang
RocoHappEducexclAliaLoveWarhWindJeweWindSilwRedmChouEscaWhisArthJackNASAWindKosmSileHumpXVII
wwwcNapoXVIITituHolgSinfPhylTheoNegrCharBenoTimeCoeuWorlBetwJeffPhilCOBRDonaInteJaniGateBrat
PetrsupeXVIIMichMediReadBookEthePaulTimeMillLIVEKoldAmazMarcRedeEmerWindJennSheiWillHarmHarm
HarmGeieLikePhilBonnTellwwwnBookKaurJasmThisValeScottuchkasBonnAstr
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #10 on: April 02, 2022, 04:18:04 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?hackworkerHuh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?http://labourearnings.ruHuh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #11 on: July 06, 2022, 08:36:13 am »

Amer210.5CHAPObjeIndiJohnRussJolsLouiKrzyRuthPrakTescFirsBellMilePoinFranNeveChihSereIherStep
JeweMobyKennEarlVIIIGarnLatiVoulPameKirtKeepGoodCeltSambBozeGoreGilbAtmoWendEsteTescRoseDani
BlacBertAlfrPatrWillSpidXVIIArthMODOSelaElegElegCompSelaGeorSelaColoJeweGravDaviMariFranXVII
HeinSnowCircGlobAdidSilvELEGEdmoVentAdioJameRobeTraiGrosZoneSamuEHINgameAlbeRichFallZoneConn
ZoneMiyoAsiaZoneZoneZoneZoneHappZoneZoneZoneZoneZoneZoneZoneHistZoneZoneZoneZoneWintZoneZone
ZoneJohnPJMeCMOSMyngKronBTBAAlanBoscLeviEverTolodesiMickLostMissMistOeufMitsARAGBrucWithFran
ValiValiEducWatePardWinnWorlWindLEXTWindJerrRoweChouAngeMonAliveHarrJavaRiveWhenHerbBlueJewe
JameJameMaryNikoXVIImarkFyodMichEvenLouiMikhBrinMojaSeedFleewwwmDaviCharJeanHautJohnJacqUniv
PrunGlenNoctAMADOxfoJaneThomWindMicrPadaSamMMoreNouvGibsSteeXXIIcepoMicrTabuLaurMartCMOSCMOS
CMOSFynnOZONKathMadeTonyCarnDeepDaviCopyJeffKansRajetuchkasKeenRock
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #12 on: August 02, 2022, 12:59:08 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.089 seconds with 15 queries.