Search code examples
htmlcssbackground-imagebackground-position

Using "background-position" but my background image is disappearing


I want to use a background image, but I'd like to adjust its position. I'd like to move it up by -10 pixels. I noticed that when I added a background position my image would disappear. So I tried setting everything to zero, so nothing would move, like so

#pageTitle {
    display: flex;
    padding: 10px;
    height: 100px;
    background-image: url(http://hddfhm.com/images/clipart-110-scale-14.jpg)
    background-position: 0px 0px;
}

but even then, my background image disappears -- https://jsfiddle.net/eq6zxpcb/5/ . If I remove

background-position: 0px 0px;

the background image appears, but its not in the place taht I want. How do I add a background position without making my image disappear?


Solution

  • #pageTitle {
        display: flex;
        padding: 10px;
        height: 100px;
        background-image: url(http://hddfhm.com/images/clipart-110-scale-14.jpg);
        background-position: 0px 0px;
    }
    

    after this background-image: url(http://hddfhm.com/images/clipart-110-scale-14.jpg) semicolon (;) was not there