CSS: Scale background image down if larger than window, keep at 100% otherwise

后端 未结 4 2087
灰色年华
灰色年华 2021-01-12 09:08

I\'d like to deploy a background image in the body of my website that scales down with the window resolution, but does not scale up beyond it\'s original size (1920x1080). T

4条回答
  •  我在风中等你
    2021-01-12 10:01

    Just a really small/quick suggestion:

    Depending on how it looks, and all flows together, background-size:contain; might be an option.

    or, on your body, set the max width to 1920, set the margins to auto, and that might also work for you.

提交回复
热议问题