开发者

centered css layout (margin:auto;) causing parent's bg to disappear when shrinking browser

开发者 https://www.devze.com 2023-02-04 17:30 出处:网络
I notice that a lot of layouts on the internet now have this bug. http://blankest.com/modex/ Visit that site.

I notice that a lot of layouts on the internet now have this bug.

http://blankest.com/modex/

Visit that site.

Re-size the browser so that you have to scro开发者_如何学运维ll horizontally.

When you scroll to the right, the background images are clipped.

Does anybody know some css trick to get this background unclipped when making the browser smaller?


Also set a min-width for the body

body {
  min-width: 980px
}


If you shrink the window smaller than the width of the main content area (if it has a fixed width), then this behaviour is expected. Backgrounds are usually placed on the body tag, and the body typically only stretches the width of the window.

Note that it happens in the footer of this very site as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号