0

My black box can not be center

Am using flex box https://code.sololearn.com/WoHys05rAkry/?ref=app

28th Nov 2021, 11:43 AM
D Doyen
D Doyen - avatar
4 Answers
+ 2
You haven't set the height of the body: body{ height: 100vh; }
28th Nov 2021, 11:51 AM
Solo
Solo - avatar
+ 2
The point is not flex, but the fact that 100% is calculated from the size of the content of the body, in your case 50 px. And 100vh is 100% of your screen height.
28th Nov 2021, 12:09 PM
Solo
Solo - avatar
+ 1
So flex box does not support 100%
28th Nov 2021, 12:01 PM
D Doyen
D Doyen - avatar
+ 1
div#loader{ display:none; text-align: center; } p{ color: black ; border: 5px solid white; }
28th Nov 2021, 2:07 PM
SoloProg
SoloProg - avatar