Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No scrollbars when using background-image css

    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:

    Code:
    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;
    }

  • #2
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    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.
    Numerology API for apps - Facebook, iPad, mobile phones. No charge to use API. [info]

  • #3
    New Coder
    Join Date
    Oct 2005
    Posts
    30
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •