Grow your CSS skills. Land your dream job.

background image z-index?

  • # April 18, 2010 at 9:24 am

    Hi guys,

    I have set an html background image, is it possible to give it a z-index so that it will be on top of the other images in the content?

    I have tried to set an z-index to it but with no success. you can see the page here http://leon-zinger.com/class-a/index.html

    for now i have done margin-right:20px to the background images that override the body background image, but this solution i hope is temporary…

    # April 19, 2010 at 2:30 pm

    No, z-index cannot be applied to a background image.
    Without doing too much digging you may be able to accomplish your goal using something like this http://css-tricks.com/perfect-full-page-background-image/ I haven’t done any testing, so i am not sure if even this will work, but it is somewhere to start.

    # April 19, 2010 at 6:28 pm

    Thanks mate, i have already took this approach: put an inline image and set a z-index to it.

    Just tried to make stuff smarter, but it does not always works like that… :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".