Search code examples
htmlcssforeground

How to make a foreground image using CSS?


I've got this image and i want to put it over my website as a foregound. It should overlap the background and the elements. I'm using CSS.

https://www.dropbox.com/s/aawxonln4h1i5dt/Snow.png?dl=0


Solution

  • If I understand correctly you want something like this:

    Html (place somewhere on top):

    <img src="URL_TO_IMAGE" id="overlay"/>
    

    CSS:

    #overlay{
    width:100%;
    position:absolute; /*You may also use fixed depending on your needs.*/
    left:0;
    top:0; /*If you want it at the bottom you probably want bottom:0 instead*/
    z-index: 999;
    }