[CSS] height: 100% has been set, and the height does not occupy the entire page

The background color does not cover the entire page 

 

 

Viewing the body is not the height of the page, setting the height of the body to 100% is still invalid

.box{
	width: 750px;
	height: 100%;
	background-color: yellowgreen;
        }

 Solution:

Set the positioning to fixed for this container

 

.box{
	position: fixed;
	width: 750px;
	height: 100%;
	background-color: yellowgreen;
}

can be solved.

 

Guess you like

Origin blog.csdn.net/liusuihong919520/article/details/127512863