Home
FAQ
Search
Memberlist
Usergroups
Galleries
Register
Log in
View previous topic :: View next topic |
Author |
Message |
rgnbtj86j Master of STF
|
Posted:
Wed 20:22, 30 Oct 2013 |
|
|

Joined: 11 Jul 2013
Posts: 9571 Read: 0 topics
Warns: 0/3
Location: England
|
While it’s far from being a new technique, the use of CSS sprites is one of my favorites, for several reasons.
A sprite is simply a group of images that have been combined into a single file. Sprites allow you to reuse your image over and over, and hide or display different sections using a little bit of CSS.
Creating A CSS Sprite
The first step is going to be creating the image, so you’ll need to open up your favorite image editor.
Before [url=http://www.fibmilano.it]woolrich outlet[/url] you create the sprite, you should have [url=http://www.riad-marrakesh.fr]abercrombie[/url] your individual images handy. Once they’re all organized and ready, you can get started.
Firstly, decide how you wish to lay out your sprite. A lost of sprites are arranged in just one column, but it is possible to go horizontal, or create a grid with rows and columns. This decision is partly going to depend upon whether your images are all the exact same size, but also on your own personal preferences.
Once you’ve decided how to line up the pictures, you’ll need to establish the total size of your sprite. Add all of the image dimensions together, based on how you plan to arrange them. If [url=http://www.par5club.com/louboutin.php]louboutin pas cher[/url] your images don’t already have a background color built in, leave a pixel of white space between each – add that to your total..
If you’re lining up 10 images which are 25px by 25 pixels, and you would like sprite with 2 [url=http://www.diecastlinks.co.uk]hollister outlet[/url] rows of 5 images, your total dimensions would be 129 pixels by 51 pixels (thats 25×5, plus 4 single pixel gaps, and 25×2 plus 1 single pixel gap).
I usually like to place my images in the order that they’re going [url=http://www.rtnagel.com/louboutin.php]louboutin[/url] to be [url=http://www.gotprintsigns.com/abercrombiepascher/]abercrombie pas cher[/url] used on the page, just for organizational purposes.
Now the [url=http://www.shewyne.com/woolrichoutlet.html]woolrich sito ufficiale[/url] 2nd image. Build a row or column as you see fit by lining the second image up alongside the 1st, and repeat this process with the rest of your images.
This will leave you with a sprite: all of your images, side by side with no touching or overlapping each other.
Now you just save your file and you’re ready to move on to the code.
CSS Sprite Code: Making It All Work
Now we’ve come to the REALLY fun part: the code that hides/displays the appropriate section of the image.
The first piece of code will define all the common characteristics your different elements share: size, display, outline, whatever they all have in common – plus the background image (your sprite) You’re including that in this first batch of common CSS because you’ll use the same image for each element – all you’re really changing is the alignment.
It’s important to remember to label this code as a container ID or class – that way you don’t affect other elements on the page.
It’s also vital that you assign a unique ID to each element within the container. That is what makes the whole process work.
Now let’s set up each elements background position. For these styles, we are going to list two elements, separated by a single space. First, the container, followed by the specific element that you are applying the background property to.
This is called “nesting.”Doing [url=http://www.diecastlinks.co.uk]hollister uk[/url] this ensures that this element, and only this element are targeted by this style – protecting you in the event that you inadvertently reuse your unique ID somewhere outside the container you’ve set up.
Now that you’ve selected the right item to apply the first section of the sprite to, you just need to add the “background-position” parameter. Assuming that the first image on the sprite is the one you’re using for your first element, the default value of “top left” will work just fine. “Top left” tells visiting browsers to align the top edges of both the background image and the element, as well as aligning the left hand images of both as well.
In addition to “top” and “left” values of “right,” “center,” and “bottom” can be used as well. You also have the option of using variables to designate how many pixels the image should shift vertically or horizontally. Now, it’s important to remember that the edge values (top, left, right, bottom) can be listed [url=http://www.shewyne.com/woolrichoutlet.html]woolrich outlet[/url] in whatever order comes naturally, but for values like “center” or a number that could apply to either axis, you must always list the x-axis (horizontal) first – that’s just how the browser is going to interpret the code.
The second line is where it gets fun. In our earlier example, we used 25 pixel images. To display the second image, our horizontal value would be 25px. This will slide the entire background image 25 [url=http://www.gotprintsigns.com/abercrombiepascher/]abercrombie soldes[/url] pixels to the left of the edge of the element. As a result, the first 25 pixels of your background are now hidden, allowing the second 25 pixels to display, giving the appearance of a completely different image.
If I lost you at all with that last step, just imagine a graph. The starting point, or 0,0, is at the top left corner of your image. You simply need to select new coordinates from [url=http://www.thehygienerevolution.com/hollister.php]hollister[/url] there to decide where the top left corner of the SPRITE should be. Positive numbers move your sprite up and right, negative down and left.
The second image would need a horizontal value of -50, to slide the sprite over one more image.
The same principle applies to displaying different rows of your sprite: just change the second value and leave the first one alone. If you have a grid, you can change both..
We did it!Our CSS is now automatically loading our background image, and placing it so that the right section is visible for each of the three buttons! You can add as many rules as you need to for as many images as you want.
And that’s really all there is to it!
1. Create your images
2. Combine your images
3. Define the common characteristics of the elements in a single style
4. Give each element a unique ID
5. Write some targeted rules for each elements unique ID
6. Take a [url=http://www.agentparadise.com]woolrich sito ufficiale[/url] nap
Sprites like these can be used for almost anything, not just buttons. You could use them for graphic bullets if you write a lot of lists, or even create fancy images of numbers for numbered lists. You can use sprites to display fancy titles on things like sidebar widgets: the sky’s the limit. Virtually anywhere you use an image, you can incorporate a sprite to speed things up.
相关的主题文章:
[url=http://www.kcn.ne.jp/~makimoto/cgi-bin/bbs.cgi]woolrich Relish The Taste Lik[/url]
[url=http://www13.plala.or.jp/white_roots/gwbbs/gwbbs.cgi]hollister france Abs-tract Bo[/url]
[url=http://www.cool3studio.com/aska/aska.cgi/aska.cgi%3C/aska.cgi]louboutin Flower Delivery Del[/url]
The post has been approved 0 times |
|
 |
|
 |
rgnbtj86j Master of STF
|
Posted:
Sat 4:30, 02 Nov 2013 |
|
|

Joined: 11 Jul 2013
Posts: 9571 Read: 0 topics
Warns: 0/3
Location: England
|
you will have a steady income throughout the year
But what about the people behind the scams? They are known locally as "Yahoo Boys", a nod to their preference for Yahoo email accounts. Journalist Sarah Lacy tracked a few down and reported that times are hard, in part because westerners have become suspicious of emails that offer them massive lottery wins. Yet, beyond the occasional encounter with an intrepid journalist, we know little about a group of people who seem [link widoczny dla zalogowanych] intent on trying to scam the entire planet..
The Duchess fuels the baby rumors as she puts her hand on her stomach for any indication of a baby bump. When skiing at any resort, it is still important to dress in layers. Be sure the rest of the garment is in good condition, however, to justify the money you will spend to purchase and attach the elbow patches.
Short booties. These were the rage during winter and continue to be popular and flattering paired with shorts and skirts. Rubber Wellies aren't for everyone, especially in warmer climates. Honestly you don need a whole lot. Personally i [link widoczny dla zalogowanych] didn get out much with my daughter(born March 07) I would invest in alot of sleepers(get the ones that button all the way up, not the ones that just button at the neck and in the crotch. Way to hard to put on a baby), because that is all you really need around the house.
'My reactions afterwards were, thank God it wasn't a younger woman who would be much more vulnerable. I've had so many knocks in life. I've had break ins in my family business last year, and I felt far more violated by that. That works [link widoczny dla zalogowanych] for her. She definitively a pants person. Need clothes that I can wear a lot.
Something I had to learn a while back when I was younger, Taylor said. Too hyped, you tend to be a little sporadic and mess up sometimes. You have to stay calm, but stay intense at the same time. The best update: you can have two players dancing simultaneously. And it's super easy to integrate another player into your groove; your friends can jump into the game at any time midsong even and a dancing avatar will appear. Simultaneous multiplayer means no more sitting around on the couch when you feel ready to trip the light [link widoczny dla zalogowanych] fantastic.
Shopping for [[clothes]] is definitely a favorite [[hobby]] for a lot of ladies. Saving [[money]] seems challenging for us. Fortunately, with self control, we can buy a [link widoczny dla zalogowanych] lot more with less. Down tunieken kunnen worden aangetrokken met geschikte bont. Rock chique uitstraling kan heel goed gaan met [link widoczny dla zalogowanych] fedora hoed, afhankelijk van de schaduw en het silhouet [link widoczny dla zalogowanych] van de kleding. Moncler jas zien er het beste bij het losknopen, vandaar, knoopte jassen met de nodige innerlijke boven te dragen..
10 or when the league starts. To think that far ahead, I'm just going to keep being here and practicing with the guys. Too, remains optimistic.. Sewing slippers makes slippers that are comfy and fit at an economical price because you can use scraps. Many years ago I made slippers as Christmas gifts for everyone on my list from Foot Prints Cozy Slipper Pattern . Today there are oodles of free patterns available online to make slipper making a very economical project or add in.
Vonduyke, who directed [link widoczny dla zalogowanych] pageants in which JonBent Ramsey competed, left the industry after the 6 year old Colorado girl was found murdered. The investigation cast a dark shadow on the contests, she said, as images of JonBent competing in pageants were shown repeatedly [link widoczny dla zalogowanych] in media reports on the ongoing investigation. Vonduyke is currently working on a book about the industry..
Once you are done with tracking a trip, you can save it and then upload it to your EveryTrail account where you can share it with the [link widoczny dla zalogowanych] world or just yourself. You are given the option to make the trip private if you so desire before uploading. You will need a cell or wifi connection to do this so it might be a task for [link widoczny dla zalogowanych] when you return to civilization..
One evening in the late autumn of 1997, Jeff and Lori Leibovitz arrived at Skiles Test Elementary School in Indianapolis for a meeting with their son Adam's first grade teacher. The Leibovitzes were upbeat. First grade conferences are typically full of wonderful [link widoczny dla zalogowanych] reports about children's wonderful progress in learning to read and write.
相关的主题文章:
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
The post has been approved 0 times |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
fora.pl - załóż własne forum dyskusyjne za darmo
|
|