Help with positioning elements on page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Help with positioning elements on page

So, why is this not working? What exactly is wrong? I am trying to have the first and third paragraph be 1/4 of the window height and the second be 1/2 of the height. I thought this is how it is done Note: I posted this over the weekend but I did not get any reply. I do need the answer and still haven't been able to figure it out. So thanks for helping out. https://code.sololearn.com/WV7rxOTuUZAb/?ref=app

17th Apr 2018, 12:43 PM
cyk
cyk - avatar
5 Answers
+ 2
Try add this to your css file: .game{ height:100%; }
17th Apr 2018, 1:04 PM
@l¡
@l¡ - avatar
+ 3
Thanks to both of you Niush and Ali! The combination of both your answers gives me exactly what I wanted. You can look at the code again to see the goal I wanted to attain and that you helped me achieve ☺
17th Apr 2018, 1:07 PM
cyk
cyk - avatar
+ 1
It is working fine. Isn't it? The p1 and p3 are indeed 25% and p2 is 50% Set background color to these item and see. It is fine.
17th Apr 2018, 12:47 PM
Niush
Niush - avatar
+ 1
No it's not. Check it out again. Added background colors. Besides, I want them to fill the whole window
17th Apr 2018, 12:50 PM
cyk
cyk - avatar
+ 1
p{ margin:0; } Completely Unexpected. But, does the job. 👌
17th Apr 2018, 1:02 PM
Niush
Niush - avatar