I am curious about how background images behave when the background-attachment
property is set to fixed
. Here are my questions:
If I set a background image for a div with dimensions of 500px by 500px and add a 1px solid red border, then apply
background-size: 100% 100%
, why does the size of the background image end up being slightly larger than 500px? And why does the size change when the viewport size changes?Is there a way to set a minimum height for the background image so that it doesn't shrink below a certain height when the viewport size changes?