如何使用CSS和HTML使主要内容div填充屏幕高度

PHPz
PHPz 转载
2023-09-06 23:53:02 594浏览

如何使用CSS和HTML使主要内容div填充屏幕高度

position 属性指定用于元素的定位方法的类型(静态、相对、绝对、固定或粘性)。

.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中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除