9

I need to have the body of all my webpages (except homepage) located on http://www.zorglegal.nl to the same height (100% browser height), so the brown bar on the right is stretched full screen from top to bottom. How can I best achieve this?

html{
    height: 100%;
}

body{
    min-height: 100%;
}

doesn't work. I also tried to set a class for the content element and tried to set it to 100% height but that doesn't work either. How can i do this?

The brown bar is a png image and is set as a background image for a fullwidth container. So if that container is 100% high, it should work. But how?

Vucko
  • 20,555
  • 10
  • 56
  • 107
user3354767
  • 203
  • 2
  • 4
  • 14
  • 100% height = window size , But when you get scroll that is more the 100%. Currently its working as expected but your requirement is different. – Help Jan 04 '16 at 12:31
  • Possible duplicate of [CSS Div stretch 100% page height](http://stackoverflow.com/questions/712689/css-div-stretch-100-page-height) – Vucko Jan 04 '16 at 12:32
  • Possible duplicate of [Make body have 100% of the browser height](http://stackoverflow.com/questions/6654958/make-body-have-100-of-the-browser-height) – Lalji Tadhani Jan 04 '16 at 12:33
  • Possible duplicate of [How to Auto Resize Website Body Based On Resolution?](http://stackoverflow.com/questions/34372832/how-to-auto-resize-website-body-based-on-resolution) – Bilal Rafique Jan 04 '16 at 12:50
  • Please don't refer to your site. That link may be dead or changed tomorrow helping no one in the future. You can insert images here. All markup should also be placed here: [mcve] In addition, you speak of a "brown bar" but I have yet to see it. – Rob Sep 08 '17 at 17:41

5 Answers5

9

You can use viewport height.

height: 100vh

This means that the div or whatever is as high as the browser window.

M4R1KU
  • 710
  • 7
  • 22
7
html, body{
    margin: 0;
    padding: 0;

    min-width: 100%;
    width: 100%;
    max-width: 100%;

    min-height: 100%;
    height: 100%;
    max-height: 100%;
}

This Css will help you to set height 100% for every page.

Vucko
  • 20,555
  • 10
  • 56
  • 107
Lara
  • 2,821
  • 7
  • 39
  • 72
0

Body Height to 100%

html, body {
    width: 100%;
    height: 100%;
}
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Umer Farooq
  • 583
  • 3
  • 17
0

Try to achieve using javascript:

$(window).bind('resize', yourclassname);

In yourclassname also use yourID, give it to parent div.

Himanshu Vaghela
  • 1,089
  • 11
  • 21
0

You can also use table property here, for cross-browser support.

    html {
    width:100%;
    height: 100%;
    display: table;
    }

    body {
        width:100%;
        display:table-cell;
    }

    html, body {
        margin: 0px;
        padding: 0px;
    }
vijayscode
  • 1,905
  • 4
  • 21
  • 37