Div centering and backgroundColor

trying to make my wrapper div to be centered,and also how can I make backgroundColor cover full page when my elements dont cover the full page
eg:-


ps: glad FCC forum is back though I’m enjoying the discord server

have you tried giving the color to the body?

also, you really need to share your code if you want specific help

yes I tried, oh I forgot added it now

  1. Move the background-color and border/radius to the #quote-box element.

  2. Add height: 100vh and justify-content: center to the wrapper.

I would add some padding to #quote-box and change width on #quote to max-width, replace the fixed margin with an auto margin, and remove the height (the content will just overflow at small screen sizes).

did it but its still not centered

You declared height twice, the second one (height 30%) is overwriting the first so your wrapper is not 100vh

#wrapper {
  height: 100vh;
  justify-content: center;
  display: flex;
  flex-direction: column;
  /*  height: 100vh gets overwritten here  */
  height: 30%;
  width: 60%;
  margin: 0 auto;
}
1 Like