Grow your CSS skills. Land your dream job.

Set Image to Auto Fit the page width

  • # March 31, 2013 at 12:17 pm

    Hi,

    I would like to get the images fit to the current page width.

    As you can see here: http://www.mangerproduction.com/what-weve-done/ the images are over the page width.

    I would like to make them to fit into the windows as they resize as well.

    How can I do that?

    Thanks!

    # March 31, 2013 at 12:53 pm

    img { width: 100%; }

    # March 31, 2013 at 1:25 pm

    Not sure that will work.

    # March 31, 2013 at 10:19 pm

    You have this applied to your media query:

    img {
    max-width: 100%;
    height: auto;
    }

    But you only have that applied to your smaller size, that’s why the bigger version breaks out.

    Having said that, you’d probably want to not use a table and make a bunch of other changes.

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

You must be logged in to reply to this topic.

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