如何使用CSS和HTML使主要内容div填充屏幕高度
原创
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填充屏幕高度的详细内容,更多请关注IT视界其它相关文章!
上一篇:哪个指令用于检测 SASS 中的错误? 下一篇:使用 CSS 在按钮悬停时淡入