position 屬性指定用于元素的定位方法的類型(靜態(tài)、相對、絕對、固定或粘性)。
在下面給出的示例中,沒有以百分比形式指定高度,也不需要 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% }
登錄后復(fù)制
以上就是如何使用CSS和HTML使主要內(nèi)容div填充屏幕高度的詳細(xì)內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!