Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .sprite-welcom1 { background-position: 0 -30px; }
- .sprite-welcom3 { background-position: 0 -109px; }
- .sprite-3 { background-position: 0 -188px; }
- <html>
- <head>
- <style>
- .sprite-welcom1 { background-position: 0 -30px; }
- .sprite-welcom3 { background-position: 0 -109px; }
- .sprite-3 { background-position: 0 -188px; }
- .sprite-bg {
- background: url(csg-495a902b04181.png) no-repeat top left;
- }
- </style>
- </head>
- <body>
- <div class="sprite-bg sprite-3"></div>
- </body>
- </html>
- <html>
- <head>
- <style>
- .sprite-container div {
- background: url(csg-495a902b04181.png) top left no-repeat;
- width: 20px; //width is neccessary
- height: 20px; //height is neccessary
- }
- .sprite-3 { background-position: 0 -188px; }
- .sprite-4 { background-position: -20px -188px; }
- </style>
- </head>
- <body>
- <div class="sprite-container">
- <div class="sprite-3"></div>
- <div class="sprite-4"></div>
- </div>
- </body>
- </html>
- .sprite-bg {
- background: url(csg-495a902b04181.png) no-repeat top left;
- width: 100px; /* (or whatever the width should be) */
- height: 100px; /* (or whatever the height should be) */
- }
- /* Bad */ .childClass2 { background-position: -10px -20px; }
- /* Good */ .parentClass1 .childClass2 { background-position: -10px -20px; }
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- .sprite-container div {
- background: transparent url(//www.yourDomain.com/csg-495a902b04181.png) no-repeat scroll 0 0;
- width: 200px; /* width is necessary */
- height: 20px; /* height is necessary */
- }
- .sprite-container .sprite-3 { background-position: 0 -188px; }
- .sprite-container .sprite-4 { background-position: -20px -188px; }
- </style>
- </head>
- <body>
- <div class="sprite-container">
- <div class="sprite-3"></div>
- <div class="sprite-4"></div>
- <!-- Empty divs are fine! Unless you *really* want text on top of
- your sprite map. :o) Btw: ­ is invisible when a hyperlink
- is wrapped around it.   is not... it creates an
- underscored hyperlink. Use ­ which is a soft-hyphen.
- -->
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment