Can a background image be larger than the div itself?

前端 未结 9 1292
天命终不由人
天命终不由人 2020-12-12 20:37

I have a footer div with 100% width. It\'s about 50px high, depending on its content.

Is it possible to give that #footer a background image that kind of overflows t

9条回答
  •  無奈伤痛
    2020-12-12 20:54

    Not really - the background image is bounded by the element it's applied to, and the overflow properties only apply to the content (i.e. markup) within an element.

    You can add another div into your footer div and apply the background image to that, though, and have that overflow instead.

提交回复
热议问题