background preloader

LES SPRITES

Facebook Twitter

Le schéma Data-URI. Data URIs make CSS sprites obsolete. I was sitting in a talk given by Facebook’s Jason Sobel at Velocity this year, when I was a bit surprised by an impassioned plea that he made at the tail end of the talk.

Data URIs make CSS sprites obsolete

To paraphrase, Jason said that CSS sprites require too much work for average web developers and that we should be pressuring the browser vendors to make this process easier. I was perplexed for a moment. CSS Sprites: What They Are, Why They're Cool, and How To Use Them. By Chris Coyier On This article has been revised and re-written several times since its very first publication in 2007, to keep the information current.

CSS Sprites: What They Are, Why They're Cool, and How To Use Them

The most recent revision was done by Flip Stewart in January 2015. #What are CSS Sprites? Spoiler alert: they aren't fairies that write your stylesheets for you. I wish. To summarize: the term "sprites" comes from a technique in computer graphics, most often used in video games. CSS Sprites is pretty much the exact same theory: get the image once, and shift it around and only display parts of it. #Why use CSS Sprites? It may seem counterintuitive to cram smaller images into a larger image. Let's look at some numbers on an actual example: That adds up to a total of 14.38KB to load the three images. While the total image size (sometimes) goes up with sprites, several images are loaded with a single HTTP request. Thus, sprites are important for the same reasons that minifying and concatinating CSS and JavaScript are important. $ sprity . #SVGs. [ws] Fast Rollovers Without Preload. English-only | Jenom česky | Bilingual/Dvojjazyčně When using CSS image rollovers, two, three, or more images must be loaded (and often be preloaded for best results).

[ws] Fast Rollovers Without Preload

We've got one image for each state (normal, hover, active, visited etc). Putting all states into one image makes dynamic changes faster and requires no preload. Let's have a simple example. The menu items are the a-elements with display:block. Fig. 1: Three states together in one image Usually, in CSS rollovers, we use background images in this way: Když vytváříme dynamická obrázková tlačítka (rollovery), musí se obvykle do prohlížeče načíst dva, tři i více obrázků (pro základní stav, pro :hover, obrázek pro :active atd.).

CSS Sprites: Image Slicing’s Kiss of Death · An A List Apart Article. Back when video games were still fun (we’re talking about the 8-bit glory days here), graphics were a much simpler matter by necessity.

CSS Sprites: Image Slicing’s Kiss of Death · An A List Apart Article

Bitmapped 2-dimensional character data and background scenery was individually drawn, much like today’s resurgent pixel art. Hundreds and later thousands of small graphics called sprites were the building blocks for all things visual in a game. Article Continues Below As game complexity increased, techniques developed to manage the multitude of sprites while keeping game play flowing. CSS Sprite Generator, Editor, and Code. The Spriters Resource. CSS Sprites: Image Slicing’s Kiss of Death · An A List Apart Article. CSS Sprite Sheet Animations with steps()

There’s a little-known timing function in CSS animations that lets us break an animation into segments––or steps––instead of running it as one continuous animation from start to finish.

CSS Sprite Sheet Animations with steps()

This function is useful for creating sprite sheet animations because we’re able to precisely display each sprite image as a frame without any easing effects inbetween. Animating with the steps() function. Animer avec les sprites SVG. Sarah Drasner montre ici comment utiliser les sprites SVG pour créer des animations complexes et responsives.

Animer avec les sprites SVG

De superbes exemples illustrent d'étonnantes possibilités d'animation, avec un code qui reste relativement simple. Par Sarah Drasner Nous savons déjà pas mal de choses sur SVG, par exemple que leur rendu est impeccable quelle que soit leur dimension, ce qui permet de réduire le nombre de requêtes HTTP pour remplacer les images, et qu’on peut les rendre facilement responsifs.

CSS Sprites with Background Positioning. There’s nothing more common than hover states to give your website some life.

CSS Sprites with Background Positioning

The user comes to your site, scrolls over an image with their mouse cursor, and the image changes. That’s it. While I spent most of 2012 learning backend programming with Ruby on Rails, I’m only recently spending more time improving my frontend development skills. Webdesign.tutsplus. Spriting with <img> Sprites aren't limited to background-image, as with the object-fit and object-position properties we can nudge an inline image around its content-box to act just like a sprite.

Spriting with <img>

For example, let's say we want the image below to be added to our HTML page like a regular ol' image: Then we'll crop the image so that only the first icon is visible on screen: Here, the content-box of the <img> should be 100px wide and 100px tall, but because the image extends beyond those boundaries, it's automatically cropped for us with object-fit: none. We might then want to use a class to nudge the image and reveal another part of it altogether: Les sprites en CSS. Définition des sprites et utilisation Un sprite d’images correspond à une collection d’images rassemblées en une seule grande image.

Les sprites en CSS

L’idée derrière l’utilisation de sprites est de réduire le nombre de requêtes serveur. Tutoriel Vidéo HTML-CSS Les Sprites CSS. Les sprites CSS. Les sprites CSS. Le temps des onmouseover, des images préchargées via JavaScript et des autres joyeusetés héritées des grandes périodes de tag soup est, comme le temps des Elfes de la Terre du Milieu, définitivement révolu : faire des effets de rollover sur des images est tout à fait possible en utilisant uniquement les CSS.

Les sprites CSS

La technique consiste à exploiter un fichier unique pour stocker de multiples images, positionnées les unes à côté des autres. Celles-ci seront ensuite appelées dans la feuille de style, et la fenêtre d'affichage sur l'une ou l'autre image sera définie en CSS grâce à la propriété background-position. Attention : la technique exposée dans ce tutoriel est à manier avec précaution car elle peut engendrer des problèmes d'accessibilité (typiquement lorsque les images ne sont pas actives).

Tout sur les sprites CSS. Les sprites combinent plusieurs images dans un fichier unique, permettant d’améliorer la performance de votre site. Ils sont largement utilisés dans les animations complexes. Belle introduction par Chris Coyier. Par Chris Coyier Cet article a été révisé et remis à jour plusieurs fois depuis sa première publication en 2007, la dernière révision date de janvier 2015.