Get a free trial // Grow your CSS skills // Land your dream job

Scaling div to image automaticly.

  • red
    # November 5, 2008 at 5:26 am

    So I’ve created a small image gallery using jquery, it works splendid but I’d like the div in which the image opens up to scale accordingly without having to set up custom width to each div. The height works automatically and is correct with all padding and margins, but.. Just check it out and you get what I mean: … leria.html … lleria.css

    I’ve tried googling, but might be that I can’t come up with the correct searchword. :l

    # November 5, 2008 at 2:38 pm

    the fastest solution is to use the lightbox effect. just google lightbox. You can then edit the lightbox css to change the background, to add an image to it or change the color. use your imagination.

    check here

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

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed