css-sprites

Get icon from single png image

有些话、适合烂在心里 提交于 2019-12-05 12:21:39
I have seen this so many times until now, but I never used myself. Can somebody explain how you can get specific icon picture from this single png image, for example the icons i selected with red ... using css That is called CSS sprites . It is used to cut down the http requests. Basically all icons are placed on a single canvas and are used as background-image property and later they are mapped using CSS background-position property, so for example .icon1 { background-image: url('YOUR_URL_HERE'); background-position: 10px 10px; /* X and Y */ height: 30px; width: 30px; } Demo So inshort just

CSS Sprite generation in gradle build process?

谁说我不能喝 提交于 2019-12-05 11:45:29
I recently read an article about Javascript, where Build Tools like Grunt and Ender were mentioned. It was briefly stated, that such tools are capable of generating sprite images from individually provided files and that these build tools can be integrated into the build process. Unfortunately my google searches didn't unveil more information on this. Does anybody here have experience on this topic and integration into gradle? Some web resources for further reading are highly welcome! Many thanks in advance! Sascha. @Windwalker you might be interested in using the SmartSprites Maven Repositry

Should I use a sprite-like technique for thumbnails on my website?

你说的曾经没有我的故事 提交于 2019-12-05 10:43:37
On a website I'm creating, I have about 100 various thumbnails (64x64) that get displayed at different times. On some pages, only 5-15 thumbnails may be displayed. On others, all 100 are loaded. I'm considering using a technique like CSS sprites to display the images. That is, rather than have image tags for each thumb, do something like: <span class=thumb1"></span> And then use CSS to take a slice of one single image with all the thumbs stitched together. That is, one image with all 100 thumbs (in this scenario, a 640x640 image). My questions: Is this a good idea? If yes, should I do it on

Using CSS Sprites on anchor tags

青春壹個敷衍的年華 提交于 2019-12-05 07:30:28
I'm looking for some CSS guru advice on best structure. I'm implementing sprites instead of icons on a horizontal 'list'. Current html is like : <a href="link"><img src="icon" /></a><a href="link_b"><img src="icon"/></a> etc. So I replace with a sprite. I'm using <a href="link" class="sprite_img_a"></a><a href="link_b" class="sprite_img_b"></a> but to do this I give the tag inline-block and width. I've never liked inline-block and it seems clunky. Are there better options ? (nested span, div wrapper ?) @karishma: inline-block is a good option but if don't want it so, you can use the CSS below.

can a background image be negatively positioned to the bottom or right, or only a portion of a picture repeated?

◇◆丶佛笑我妖孽 提交于 2019-12-05 02:56:58
I'm putting together a sprite and have two questions. Something I've always wondered whether possible is negatively positioning a background picture to the right or bottom. A negative position is bread and butter stuff on the left of an element or top but what about the right and bottom? If I have a 500px by 500px div can I then position the left edge of a background image to appear 5px in from the right using a negative value rahter than 495px to push it over? The second question is whether I can use just a small portion of an image and repeat it without the rest of the image showing. For

How to create a sprite from a folder with and without background-size (using Compass)

六眼飞鱼酱① 提交于 2019-12-05 01:32:26
问题 I want to use a Compass generated icon-sprite for two different scenarios. Use the icon(s) in original size. Use it the same icon(s) as a smaller version using CSS3 property background-size . I first do this: $logo-spacing: 20px; @import "logo/*.png"; @include all-logo-sprites; Now I can use the general created CSS-classes like .logo-twitter etc. Two achieve the second result I could use this (darren131 / gist:3410875 - resize sprites in Compass): @mixin resize-sprite($map, $sprite, $percent)

Any examples to know about css sprites?

谁说我不能喝 提交于 2019-12-04 18:33:12
I know about css sprites.. Now i want some examples of css sprites.... How did you manage to get css sprites work? I usaully use the CSS background property. This property allows you to set a scroll argument of top and left as you can see in the example below. So the idea is to create one image with all states and simply position it based on the event like hover or other custom event in which you alter the elements CSS. I hope this helps. .mySprite a { background: transparent url(/images/spriteButton.gif) no-repeat scroll 0 0 } .mySprite a:hover { background: transparent url(/images

Can't get CSS Sprite to work..what am I doing wrong?

孤人 提交于 2019-12-04 16:42:45
I am using CSS Sprite Generator to create sprites for a web page I am working on, but it doesn't seem to work, and I don't know why...I guess it's something obvious but..! So, I picked up 3 images, zipped, generated the PNG file (I checked out the result it is seems fine) and I got the following css classes back: .sprite-welcom1 { background-position: 0 -30px; } .sprite-welcom3 { background-position: 0 -109px; } .sprite-3 { background-position: 0 -188px; } So here is the HTML I am testing on, and for some reason all I get is a nice blank page: <html> <head> <style> .sprite-welcom1 { background

IE6: Background-Image Load Event

旧时模样 提交于 2019-12-04 16:03:26
问题 I am displaying a bunch of thumbnail images and the latency can be very high (over a VPN) so I send all the thumbnails in a single file (like a sprite) and set the CSS background-image and background-position properties of a div to show the thumbnails. The problem I'm having is with IE6 and figuring out when the image has loaded... I'm using the BackgroundImageCache hack: document.execCommand("BackgroundImageCache",false,true); To check when the image is loaded I use this code: $('<img>')

Image spriting with mod_pagespeed

亡梦爱人 提交于 2019-12-04 06:05:00
问题 I've installed Google mod_pagespeed on Apache 2.2 and everything seems to be working except for the fact the image spriting is not working. I've set the LogLevel to debug and the only message I'm getting is: [Mon Mar 10 17:51:58 2014] [info] [mod_pagespeed 1.6.29.7-3566 @26487] Attempting to sprite css background. No further messages related to spriting show up in the logs. I can also confirm the Image Spriting is switched on: /mod_pagespeed_statistics?config Configuration: Version: 13: on