Grow your CSS skills. Land your dream job.

Sliding out an image and reveal some content behind it

  • # January 9, 2012 at 6:05 pm

    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

    # January 11, 2012 at 1:54 pm

    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.

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

You must be logged in to reply to this topic.

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