hi so i am making a webapp and i am using a gradient as the background right now. I am wondering on why there is a blue background at the bottom of my screen for no reason. Here is the code and screenshot.
https://phpout.com/wp-content/uploads/2024/02/RXqnL.png
codepen: https://codepen.io/AviPlayz247/pen/QWomyLe
As you can see like in the codepen, there is a blue background at the bottom instead of the gradient continuted. Does anyone know why?
Some fixes i tried included like setting body min-height: 100%
and for the html tag but it didn’t really fix anything at all. If anyone can help me with this issue that i am encountering that would be great! Thanks!
2
Answers
Here’s a simple example with a 100% tall element that has a gradient which fully covers it, regardless of size, even if the content needs to scroll.
The way I would address this is with
background-attachment
The MDN page describes ‘fixed’ this way:
You could also increase the 100% in your background as the end point to 200%, say. Or another value.