Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Make dive (in wrapper div) width as screenwidth.

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244219
    Kristov
    Participant

    Hey,

    This homepage has pictures in a div.
    http://lauratolleneer.be/

    The div that holds the pictures is in the wrapper-div that gives the width of all content a +- 80% of the screen… (change on width screen = responsive).

    Now I want to change the width of the pictures: become as width as the browser screen. BUT the div should stay in the wrapper div…

    Is this possible? Make a div/picture come out of his wrapper div?
    Responsive solution please ;-)

    Thanks in advance!
    Wondering if this possible with just changing some lines in CSS only :-)

    Kristof

    #244220
    bearhead
    Participant

    Here is a simple method to do it:
    http://codepen.io/kvana/pen/rLqWoZ

    There was actually a post a few days ago with other methods:
    https://css-tricks.com/full-width-containers-limited-width-parents/

    #244221
    Kristov
    Participant

    Hi,

    Thanks for your reply BearHead!!!

    But what if my wrapper div is 960px on a desktop…

    And only in percentage on smaller screens (90% done width media query).

    Kristof

    #244222
    bearhead
    Participant

    You would just use different margins for the 960px-wide parent case. The article I linked to shows a method for that:

    .fullwidth {
    margin-left: calc(-100vw / 2 + 960px / 2);
    margin-right: calc(-100vw / 2 + 960px / 2);
    }

    You might also have to add
    html { overflow-x: hidden }

    to work around a bug in how view units are calculated when a scroll bar is involved.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.