Why does width:100%; not fill the whole screen? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

Why does width:100%; not fill the whole screen?

Whenever I set an element's width to 100%, I always see some white lines at the left and right side of the screen. How can I make it fill it all? https://code.sololearn.com/Wh0osGP827M5/?ref=app

10th Feb 2018, 3:44 PM
ReimarPB
ReimarPB - avatar
3 ответов
+ 2
@ReimarPB Use this code for ur css : position :absolute; top: 0; left: 0; bottom :0; right: 0; height :100%; width :100%; background-color :blue;
10th Feb 2018, 5:03 PM
Kevin Vaz
Kevin Vaz - avatar
+ 1
Bcoz u set the height to 50px, set it to 100% and it'll cover the screen, set height: 100%;
10th Feb 2018, 4:41 PM
Kevin Vaz
Kevin Vaz - avatar
0
@Kenvin Vaz that's not what I meant by the whole screen... Try set both width and height to 100%. You will still see a white outline. Thats what I'm talking about.
10th Feb 2018, 4:50 PM
ReimarPB
ReimarPB - avatar