0

I am new to angular as in just starting. I have built this small angular app and when I edit the style.css file and add a background-color property to the body tag only the section around my form is getting colored and not the whole page (refer to the image to understand better). Can someone explain to me why?? Any explanation would be appreciated. this is the code snippet from the style.css file

/* You can add global styles to this file, and also import other style files */
@import "bulma/css/bulma.css";
body {
  background-color: burlywood;
}

.passbox {
  margin-top: 5%;
}

enter image description here

Temani Afif
  • 245,468
  • 26
  • 309
  • 415

2 Answers2

0

Because the height of your body stops at that point (because there is no more content) so as a result, the body will not fit the whole screen, instead you could use min-height: 100vh for <body>

/* You can add global styles to this file, and also import other style files */
@import "bulma/css/bulma.css";

body {
  background-color: burlywood;
  min-height: 100vh;
  margin: 0;
}
<body>

</body>
Mhd Alaa Alhaj
  • 2,438
  • 1
  • 11
  • 18
0

You will notice, upon inspection, that the body does not actually fill the entire screen. So, what you need to do, is find a way to make it (the body) full.

  1. According to this answer, adding height: 100vh; may do it.
  2. According to this link, adding background-size: cover; can fix it

While I do not have the full answer myself, I hope that by heading you in the right direction you'll be able to refine your search and find what you're looking for :-)

Good luck!

PMO1948
  • 2,210
  • 11
  • 34