如何使用CSS和HTML使主要内容div填充屏幕的高度
的位置属性指定用于一个元件(静态,相对的,绝对的,固定的,或粘性的)定位方法的类型。
在下面给出的示例中,没有以百分比指定高度,也不需要jQuery
.mainbody{ position: absolute;//here we are setting the position of an element as absolute top: 30px; /* here we are defining Header Height to 30 px */ bottom: 10px; /*here we are defining Footer Height to 10 px */ width: 100%;// here we are setting the width to 100% }