Search code examples
htmlcssbackground-imagebackground-position

Background positions


This Image I'm using for making 3 direction animation. I need to show only first character of this image. Well i am using background position-

background-position:0px 200px;

But it is showing full image here.

Styles

position:absolute;
    top: 40px;left: 40px;
background-position: 0px 200px;

Image- Image i want to use for first character

Please guide me through Js fiddle. Fiddle


Solution

  • see this link i hope this will help for you: http://jsfiddle.net/9RYph/7/

    div {
    
        top: 40px;left: 40px;
        background-size:100%;
        background:url('https://i.sstatic.net/PuAjg.jpg');
        width: 50%;
        height: 600px;
    }