Search code examples
htmlcssbackgroundbackground-imagebackground-color

CSS background image is not working as expected


For some reason image background set via background is not working.

Developer tools in both Chrome and Firefox are showing that the image background set and the link to the image is working, but for some reason it is not showing.

.footer-mold { 
    background: url('http://www.example.com/images/footer-bg.jpg') no-repeat left top;
}

Here is a link to site - https://www.pamoldremoval.com/blog/ .


Solution

  • The height of .footer-mold is 0, since everything inside is floating and you don't clear anything.

    One solution would be add

    .footer-mold::after {
        clear: both;
        display: block;
        content: '';
    }
    

    to the stylesheet.