SlideShare a Scribd company logo
1 of 14
CSS Sprites & Rollovers
CSS Sprites
CSS Sprites - History


The origin of the term "sprites" comes from old school
computer graphics and the video game industry. The idea
was that the computer could fetch a graphic into
memory, and then only display parts of that image at a
time, which was faster than having to continually fetch new
images. The sprite was the big combined graphic. CSS
Sprites is pretty much the exact same theory: get the image
once, shift it around and only display parts of it, saves the
overhead of having to fetch multiple images.

http://css-tricks.com/css-sprites
CSS Sprites - History



In 2004, Dave Shea suggested a simple CSS-based
approach to CSS sprites based on the practice
established by those legendary video games. In this
case, multiple images used throughout a website
would be combined into the so-called “master
image.” To display a single image from the master
image, one would use the background-position
property in CSS, defining the exact position of the
image to be displayed. Any hover, active or focus
effects would be implemented using the simple
definition of the background-position property for the
displayed element.

http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-
css-sprites-techniques-tools-and-tutorials/
When the page is loaded, it would not load single
images one by one (nor hover-state images per
request), but would rather load the whole master image
at once. It may not sound like a significant
improvement, but it actually was: the main
disadvantage of the onMouse effects is that JavaScript-
based hover effects require two HTTP requests for
each image, which takes time and creates that
unpleasant “flickering” of images. Because the master
image is loaded with the whole page only once with
CSS sprites, no additional HTTP requests are needed
for hover, active or focus effects (because the image is
already loaded), and no “flickering” effect occurs.

http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-css-
sprites-techniques-tools-and-tutorials/
Using the background-position property


 The background-position property defines the initial position of a background-image.




  #star{                                        #star{
  background-image: url(‘star.gif’);            background-image: url(‘star.gif’);
  background-position: 0 0;                     background-position: 20px 20px;
  }                                             }
Using the background-position property


    background-position: [horizontal position] [vertical position];



                                                         20px


                                             20px




  #star{                                 #star{
  background-image: url(‘star.gif’);     background-image: url(‘star.gif’);
  background-position: 0 0;              background-position: 20px 20px;
  }                                      }
Using the background-position property


 The background-position property accepts one or two length values, percentages, or keywords.
 Specify the horizontal position using one of the following keywords: left, center, or right.
 To set the vertical position, the following values are used: top, center, and bottom.



      background-position: left top; /* same as 0% 0% */
      background-position: left center; /* same as 0% 50% */
      background-position: left bottom; /* same as 0% 100% */
      background-position: right top; /* same as 100% 0% */
      background-position: right center; /* same as 100% 50% */
      background-position: right bottom; /* same as 100% 100% */
      background-position: center top; /* same as 50% 0% */
      background-position: center center; /* same as 50% 50% */
      background-position: center bottom; /* same as 50% 100% */
Using the background-position property


    background-position: [horizontal position] [vertical position];




  #star{                                 #star{
  background-image: url(‘star.gif’);     background-image: url(‘star.gif’);
  background-position: left top;         background-position: right bottom;
  }                                      }
Using one sprite for multiple divs:
Using one sprite for multiple divs:



                                      Image Sprite:
Using a sprite to create a CSS Rollover



Rollover Example: http://davidwalsh.name/demo/css-sprites.php




                  Inactive
                                                                Rollover
Using a sprite to create a CSS Rollover




                                          The Image:
Using a sprite to create a CSS Rollover




                  Inactive:
                  background-position: 191px 0;




                  Rollover:
                  background-position: 0 0;

More Related Content

Viewers also liked

Burgers tonen lef masterthese definitief 3 h
Burgers tonen lef masterthese definitief 3 hBurgers tonen lef masterthese definitief 3 h
Burgers tonen lef masterthese definitief 3 hMieke Sanden, van der
 
Intro to Inbound: Creating Buyer Personas
Intro to Inbound: Creating Buyer PersonasIntro to Inbound: Creating Buyer Personas
Intro to Inbound: Creating Buyer Personaskyasi
 
Kgigroep luchlezing rochdale 2 d
Kgigroep luchlezing rochdale 2 dKgigroep luchlezing rochdale 2 d
Kgigroep luchlezing rochdale 2 dQuietroom Label
 
Od webcast-cloud-fraud final
Od webcast-cloud-fraud finalOd webcast-cloud-fraud final
Od webcast-cloud-fraud finalOracleIDM
 
Decisão de Celso de Mello de manter Moreira Franco
Decisão de Celso de Mello de manter Moreira FrancoDecisão de Celso de Mello de manter Moreira Franco
Decisão de Celso de Mello de manter Moreira FrancoMiguel Rosario
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitionshstryk
 
F93 b6662 b39f-4cf6-9d0cf8fc4b38800a
F93 b6662 b39f-4cf6-9d0cf8fc4b38800aF93 b6662 b39f-4cf6-9d0cf8fc4b38800a
F93 b6662 b39f-4cf6-9d0cf8fc4b38800aCarlos Carvalho
 
Inadimplência do consumidor, professor Samy Dana.
Inadimplência do consumidor, professor Samy Dana.Inadimplência do consumidor, professor Samy Dana.
Inadimplência do consumidor, professor Samy Dana.FGV-EAESP
 
Клубная встреча 25.12.2016 Итоги 2016 года
Клубная встреча 25.12.2016 Итоги 2016 годаКлубная встреча 25.12.2016 Итоги 2016 года
Клубная встреча 25.12.2016 Итоги 2016 годаЕлена Шальнова
 
Interactive Reader + Foldable
Interactive Reader  + FoldableInteractive Reader  + Foldable
Interactive Reader + Foldablejmori1
 
Indigenous Partnership in Action – Report on International Workshop on Indige...
Indigenous Partnership in Action – Report on International Workshop on Indige...Indigenous Partnership in Action – Report on International Workshop on Indige...
Indigenous Partnership in Action – Report on International Workshop on Indige...Wayne Dunn
 
Presentación de informatica (2014)
Presentación de informatica (2014)Presentación de informatica (2014)
Presentación de informatica (2014)MiCIBERauLaX PC
 
Element Booklet
Element BookletElement Booklet
Element Bookletjmori1
 
Современные представления о структуре дыхательного центра
Современные представления о структуре дыхательного центраСовременные представления о структуре дыхательного центра
Современные представления о структуре дыхательного центраcrasgmu
 

Viewers also liked (20)

Burgers tonen lef masterthese definitief 3 h
Burgers tonen lef masterthese definitief 3 hBurgers tonen lef masterthese definitief 3 h
Burgers tonen lef masterthese definitief 3 h
 
Intro to Inbound: Creating Buyer Personas
Intro to Inbound: Creating Buyer PersonasIntro to Inbound: Creating Buyer Personas
Intro to Inbound: Creating Buyer Personas
 
Kgigroep luchlezing rochdale 2 d
Kgigroep luchlezing rochdale 2 dKgigroep luchlezing rochdale 2 d
Kgigroep luchlezing rochdale 2 d
 
Od webcast-cloud-fraud final
Od webcast-cloud-fraud finalOd webcast-cloud-fraud final
Od webcast-cloud-fraud final
 
2011 2012 annual report
2011 2012 annual report2011 2012 annual report
2011 2012 annual report
 
Decisão de Celso de Mello de manter Moreira Franco
Decisão de Celso de Mello de manter Moreira FrancoDecisão de Celso de Mello de manter Moreira Franco
Decisão de Celso de Mello de manter Moreira Franco
 
Клубная встреча 13112016
Клубная встреча 13112016Клубная встреча 13112016
Клубная встреча 13112016
 
CSS3 Transitions
CSS3 TransitionsCSS3 Transitions
CSS3 Transitions
 
F93 b6662 b39f-4cf6-9d0cf8fc4b38800a
F93 b6662 b39f-4cf6-9d0cf8fc4b38800aF93 b6662 b39f-4cf6-9d0cf8fc4b38800a
F93 b6662 b39f-4cf6-9d0cf8fc4b38800a
 
AEF4 2C 1
AEF4 2C 1AEF4 2C 1
AEF4 2C 1
 
Inadimplência do consumidor, professor Samy Dana.
Inadimplência do consumidor, professor Samy Dana.Inadimplência do consumidor, professor Samy Dana.
Inadimplência do consumidor, professor Samy Dana.
 
Клубная встреча 25.12.2016 Итоги 2016 года
Клубная встреча 25.12.2016 Итоги 2016 годаКлубная встреча 25.12.2016 Итоги 2016 года
Клубная встреча 25.12.2016 Итоги 2016 года
 
68 avenue Gurgaon 7428424386
68 avenue Gurgaon 742842438668 avenue Gurgaon 7428424386
68 avenue Gurgaon 7428424386
 
Interactive Reader + Foldable
Interactive Reader  + FoldableInteractive Reader  + Foldable
Interactive Reader + Foldable
 
Guide leaving your small business
Guide leaving your small businessGuide leaving your small business
Guide leaving your small business
 
Indigenous Partnership in Action – Report on International Workshop on Indige...
Indigenous Partnership in Action – Report on International Workshop on Indige...Indigenous Partnership in Action – Report on International Workshop on Indige...
Indigenous Partnership in Action – Report on International Workshop on Indige...
 
Presentación de informatica (2014)
Presentación de informatica (2014)Presentación de informatica (2014)
Presentación de informatica (2014)
 
Element Booklet
Element BookletElement Booklet
Element Booklet
 
Современные представления о структуре дыхательного центра
Современные представления о структуре дыхательного центраСовременные представления о структуре дыхательного центра
Современные представления о структуре дыхательного центра
 
SETT2014 PDF
SETT2014 PDFSETT2014 PDF
SETT2014 PDF
 

Similar to Sprites rollovers

16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / BackgroundIn a Rocket
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSSRachel Andrew
 
GOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatGOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatRachel Andrew
 
Building Reusable SwiftUI Components
Building Reusable SwiftUI ComponentsBuilding Reusable SwiftUI Components
Building Reusable SwiftUI ComponentsPeter Friese
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
PreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 TricksPreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 Tricksincidentist
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogigorgentry
 
Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1lokku
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?Denise Jacobs
 
10 CSS Tricks and Tips to Create Astounding Websites
10 CSS Tricks and Tips to Create Astounding Websites10 CSS Tricks and Tips to Create Astounding Websites
10 CSS Tricks and Tips to Create Astounding WebsitesSyntactics Inc.
 
Presentation-1-1.pptx
Presentation-1-1.pptxPresentation-1-1.pptx
Presentation-1-1.pptxIvanPasana
 

Similar to Sprites rollovers (20)

16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
web page
web pageweb page
web page
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
 
GOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatGOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for that
 
Building Reusable SwiftUI Components
Building Reusable SwiftUI ComponentsBuilding Reusable SwiftUI Components
Building Reusable SwiftUI Components
 
Revolver
RevolverRevolver
Revolver
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
PreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 TricksPreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 Tricks
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blog
 
Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 
Chapter6
Chapter6Chapter6
Chapter6
 
Drawing images
Drawing imagesDrawing images
Drawing images
 
Css sprite
Css spriteCss sprite
Css sprite
 
Parallax effect in css by Khubaib
Parallax effect in css by KhubaibParallax effect in css by Khubaib
Parallax effect in css by Khubaib
 
10 CSS Tricks and Tips to Create Astounding Websites
10 CSS Tricks and Tips to Create Astounding Websites10 CSS Tricks and Tips to Create Astounding Websites
10 CSS Tricks and Tips to Create Astounding Websites
 
Presentation-1-1.pptx
Presentation-1-1.pptxPresentation-1-1.pptx
Presentation-1-1.pptx
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 

More from hstryk

CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2hstryk
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013hstryk
 
Lesson2
Lesson2Lesson2
Lesson2hstryk
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3hstryk
 
Building a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSSBuilding a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSShstryk
 
Lecture4
Lecture4Lecture4
Lecture4hstryk
 
Tutorial1 - Part 2
Tutorial1 - Part 2Tutorial1 - Part 2
Tutorial1 - Part 2hstryk
 
Tutorial1
Tutorial1Tutorial1
Tutorial1hstryk
 
Project1
Project1Project1
Project1hstryk
 
Lesson 3
Lesson 3Lesson 3
Lesson 3hstryk
 
Lesson2
Lesson2Lesson2
Lesson2hstryk
 
Lesson1
Lesson1Lesson1
Lesson1hstryk
 
Heather Strycharz - Resume
Heather Strycharz - ResumeHeather Strycharz - Resume
Heather Strycharz - Resumehstryk
 

More from hstryk (15)

CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013
 
Lesson2
Lesson2Lesson2
Lesson2
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Building a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSSBuilding a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSS
 
Lecture4
Lecture4Lecture4
Lecture4
 
Tutorial1 - Part 2
Tutorial1 - Part 2Tutorial1 - Part 2
Tutorial1 - Part 2
 
Tutorial1
Tutorial1Tutorial1
Tutorial1
 
Project1
Project1Project1
Project1
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Lesson2
Lesson2Lesson2
Lesson2
 
Lesson1
Lesson1Lesson1
Lesson1
 
Heather Strycharz - Resume
Heather Strycharz - ResumeHeather Strycharz - Resume
Heather Strycharz - Resume
 

Recently uploaded

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 

Recently uploaded (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

Sprites rollovers

  • 1. CSS Sprites & Rollovers
  • 3. CSS Sprites - History The origin of the term "sprites" comes from old school computer graphics and the video game industry. The idea was that the computer could fetch a graphic into memory, and then only display parts of that image at a time, which was faster than having to continually fetch new images. The sprite was the big combined graphic. CSS Sprites is pretty much the exact same theory: get the image once, shift it around and only display parts of it, saves the overhead of having to fetch multiple images. http://css-tricks.com/css-sprites
  • 4. CSS Sprites - History In 2004, Dave Shea suggested a simple CSS-based approach to CSS sprites based on the practice established by those legendary video games. In this case, multiple images used throughout a website would be combined into the so-called “master image.” To display a single image from the master image, one would use the background-position property in CSS, defining the exact position of the image to be displayed. Any hover, active or focus effects would be implemented using the simple definition of the background-position property for the displayed element. http://coding.smashingmagazine.com/2009/04/27/the-mystery-of- css-sprites-techniques-tools-and-tutorials/
  • 5. When the page is loaded, it would not load single images one by one (nor hover-state images per request), but would rather load the whole master image at once. It may not sound like a significant improvement, but it actually was: the main disadvantage of the onMouse effects is that JavaScript- based hover effects require two HTTP requests for each image, which takes time and creates that unpleasant “flickering” of images. Because the master image is loaded with the whole page only once with CSS sprites, no additional HTTP requests are needed for hover, active or focus effects (because the image is already loaded), and no “flickering” effect occurs. http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-css- sprites-techniques-tools-and-tutorials/
  • 6. Using the background-position property The background-position property defines the initial position of a background-image. #star{ #star{ background-image: url(‘star.gif’); background-image: url(‘star.gif’); background-position: 0 0; background-position: 20px 20px; } }
  • 7. Using the background-position property background-position: [horizontal position] [vertical position]; 20px 20px #star{ #star{ background-image: url(‘star.gif’); background-image: url(‘star.gif’); background-position: 0 0; background-position: 20px 20px; } }
  • 8. Using the background-position property The background-position property accepts one or two length values, percentages, or keywords. Specify the horizontal position using one of the following keywords: left, center, or right. To set the vertical position, the following values are used: top, center, and bottom. background-position: left top; /* same as 0% 0% */ background-position: left center; /* same as 0% 50% */ background-position: left bottom; /* same as 0% 100% */ background-position: right top; /* same as 100% 0% */ background-position: right center; /* same as 100% 50% */ background-position: right bottom; /* same as 100% 100% */ background-position: center top; /* same as 50% 0% */ background-position: center center; /* same as 50% 50% */ background-position: center bottom; /* same as 50% 100% */
  • 9. Using the background-position property background-position: [horizontal position] [vertical position]; #star{ #star{ background-image: url(‘star.gif’); background-image: url(‘star.gif’); background-position: left top; background-position: right bottom; } }
  • 10. Using one sprite for multiple divs:
  • 11. Using one sprite for multiple divs: Image Sprite:
  • 12. Using a sprite to create a CSS Rollover Rollover Example: http://davidwalsh.name/demo/css-sprites.php Inactive Rollover
  • 13. Using a sprite to create a CSS Rollover The Image:
  • 14. Using a sprite to create a CSS Rollover Inactive: background-position: 191px 0; Rollover: background-position: 0 0;