+ 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
4 Respuestas
+ 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
0
set *{ margin :0; } first of your css code
17th Jul 2024, 11:00 PM
muhammad Soleymanzadeh