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 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    88
    Thanks
    4
    Thanked 1 Time in 1 Post

    css div background doesnt repeat with content

    Hi,

    Title might be slightly wrong, it does repeat but only if i set the size, i have set height to 300px to show you. How do i get it to continue repeating with the content that's in the div's which are placed inside it?

    http://www.designerhost.co.uk/latics

    Many Thanks

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,826 Times in 1,810 Posts
    Hello reyna12,
    Clear your floats and the container will expand, along with the background image, to enclose it's content. No need for height here.

    Try this -
    Code:
    #contentbg {
    	background: url(images/contentbg.png) repeat-y;
    	width: 985px;
    	margin-top: -40px;
    /*height: 300px;*/
    overflow: auto;
    }
    http://www.quirksmode.org/css/clearing.html
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    88
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Excavator View Post
    Hello reyna12,
    Clear your floats and the container will expand, along with the background image, to enclose it's content. No need for height here.

    Try this -
    Code:
    #contentbg {
    	background: url(images/contentbg.png) repeat-y;
    	width: 985px;
    	margin-top: -40px;
    /*height: 300px;*/
    overflow: auto;
    }
    http://www.quirksmode.org/css/clearing.html
    adding the overflow line just adds scrollbars to the div :S

  • #4
    New Coder
    Join Date
    Jan 2006
    Posts
    88
    Thanks
    4
    Thanked 1 Time in 1 Post
    nevermind, i was using clear but stupidly at the same time as setting the div height. all sorted thanks


  •  

    Posting Permissions

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