# How to make the main content div fill height of screen with CSS and HTML

CSSWeb DevelopmentFront End Technology

The position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).

In the below-given example, no height is specified in percentage and no jQuery is needed

.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%
}
Published on 21-Mar-2018 09:44:15