Grow your CSS skills. Land your dream job.

Responsive image wider than fluid parent element

  • # January 13, 2013 at 3:53 pm

    I’ve got the following problem:

    In a responsive design with percentage widths, I want all content to have some space left and right. So I gave the parent container some padding instead of giving every content element a margin.

    Here is an [example Pen](http://codepen.io/uneart/pen/sJtzE).

    The problem is that I want some big images with a specific class to fill out the full width of the container. With fixed widths I would just give it a negative margin and increase the width accordingly.

    But as everything should be percentage based, I can’t figure out the best way to do it.
    I got it working with just playing with the width values but it doesn’t feel right.

    Any ideas?

    # January 13, 2013 at 5:31 pm

    @uneart,

    [Here…](http://codepen.io/jiri/full/EiLah “”) how I would go about it.

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".