How to sprite body background in CSS


Tags: css

Problem :

I'm working on small php script.

I have problem with css sprites. I have image with 96px the left side is 48px the right side is 48px. I want to use the left side of image as body background. And i want to use the right side of the image as backgroud of div. The problem is i don't know how to use the left side as background.

Help please.



Solution :

You can't. Sprites only work when you can limit the size of the element to the size of the section of the image you want to display.

Use separate images.


    CSS Howto..

    How do I reference this textarea and checkbox?

    How do I design a css gradient to look like the attached Facebook Login screen

    CSS page headers - how to use print margins?

    How to cut divs both ways to keep the objects in center?

    How can I apply text attributes to text in a list in CSS

    How do I create a class hierarcy in CSS for MVC4 Razor?

    How to get dynamic css layout like that:

    jquery css how to retain position if you remove margin

    Where and how do i call different CSS for different browsers in my MVC website?

    How can I add a border to the right side of this object?

    How can I style a select option like a table?

    How to hold a css style on hover

    How to structure elements in jQuery Mobile

    How to slide a div from bottom using pure css or pure javascript

    How do I set a different background to current tab?

    How to change asp:DropDownList extended background color ? CSS class

    Css Tricks - How to align 4 div's

    How to make a 3D banner overlay (??) with CSS

    How do I change CSS submenu width so it doesn't used the same width as the main menu?

    contenteditable does not show pseudoselector :before in safari

    How to create border corner spacing in CSS

    How to prevent transition to run on page load after height is set with javascript in Safari?

    How can I use webpack to copy files to the distribution folder?

    How to set borders between children from parent in CSS?

    How to reference a Div after each h3

    How do I specify a css margin-top for foundation row div?

    Can someone help me to know how I can make my layout work in small screen using css , css3?

    how to make smooth css transition

    How to create custom buttons with arrows for twitter bootstrap?

    CSS three inline elements with align from left to right, how to occupy all available width