Setting body height to 100%

痞子三分冷 提交于 2019-12-05 03:30:09

You can use viewport height.

height: 100vh

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

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

Try to achieve using javascript:

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

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

Umer Farooq

Body Height to 100%

html, body {
    width: 100%;
    height: 100%;
}

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;
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!