View Full Version : No scrollbars when using background-image css

06-19-2012, 11:59 AM
Hi. I'm new to html and I'm having trouble getting scroll bars to appear on the webpage when using the 'background-image' element in css. It works fine if I use the element <img src="xxxx.jpg" /> in the html code, otherwise I get a cut off image with no scroll bars, even when I make the webpage smaller, still no scroll bars. Your help much appreciated.

Css code below:

body {
background-image: url('xxxx.jpg');
background-color: #000000;
background-repeat: no-repeat;
background-position: top;
margin: 0px auto;
font-family: Verdana, Geneva, Arial, sans-serif;
color: #5B544C;

Will Bontrager
06-19-2012, 01:58 PM
Yes, a background image will not generate scrollbars.

If the background image is too large for the container, only the part within the container will be visible.

06-19-2012, 05:45 PM
If you don't want the background to get cut off, just set the height and width (or min-height and min-width) of the container (in this case, the body) to be at least as large as the background image.