0

I want to make a background image in the body that won't maintain the aspect ratio of the ratio.

html,
body {
  height: 100%;
  background-image: url(../images/xmasbg13.jpg);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

The code above works fine if the browser window is in full screen. But when I resize the browser, it maintains the aspect ratio of the image and won't cover the whole page.

codiplex
  • 159
  • 1
  • 4
  • 16

1 Answers1

0

How about background-size:cover

http://jsfiddle.net/2ez1e3mn/

You can resize the results pane and the image resizes (full height and width) with it.

Cynthia
  • 5,273
  • 13
  • 42
  • 71