position 属性指定用于元素的定位方法的类型(静态、相对、绝对、固定或粘性)。
在下面给出的示例中,没有以百分比形式指定高度,也不需要 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% }
以上就是如何使用CSS和HTML使主要内容div填充屏幕高度的详细内容,更多请关注php中文网其它相关文章!
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号