1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Image CSS problem

Discussion in 'Web Design' started by proph37, Aug 16, 2012.

  1. proph37

    proph37 Newbie

    Joined:
    Apr 5, 2012
    Messages:
    40
    Likes Received:
    10
    I have <img> element called right after <body> one. The image element includes following id with attributes and serves as a background of whole page(body) with possibility of resizing(thats the function of this part of code):


    Code:
    #img.source-image {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
    


    How come this image overrides following id's background


    Code:
    #mainPicture
    {
    clear:both;
    width:670px;
    height:345px;
    background-color:#160306;
    }
    
    And not just this id, every div which includes id from css with background

    What I want is actually this picture to be under everything
     
    Last edited: Aug 17, 2012
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,155
    Google "css z-index" ;)
     
  3. proph37

    proph37 Newbie

    Joined:
    Apr 5, 2012
    Messages:
    40
    Likes Received:
    10
    Thanks solved! At first i thought this only works for text