treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Sliding out an image and reveal some content behind it

  • Hello,

    I have a problem concerning CSS.

    I got inspired by some work of Dino Latoga.

    When you follow the link you will see a few examples of hovering effects. I wanted to make the bottom left one available for any image (not just for those with a defined width and height).

    I understood the way of sliding the image to the side. What I need is something like a selector to the images width(I think), so I can slide the image as far as the images width.

    margin-left: .image.width


    Thanks

    Lars
  • Lars,

    As you stated, you're looking to add this to various images where you do not know the previous images width or height. You'll probably need to incorporate some jQuery to figure out the width of the image and then apply a margin based on that figure on the fly. It's definitely possible to do, but not just with CSS.