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 to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Background for Div not rendering

    I'm having a problem getting the background to render on a container div.


    Code:
       <div id="container">    
    		<div id="rightsidebar">
                    <div id="leftsidecontent">
                    </div>
    		</div>
    	</div>
    
    #container				{float:right; width:100%; background:background:url(../images/contentwide.png) right repeat-y;}
    rightside				{ width: 200px;height:620px; padding-top: 30px; float: right;}
    #content				{ width: 650px; float:right; margin:25px 20px 0 0; float:left;	}
    The container div sizes itself to to the largest floating div inside (yay) but doesn't render the background at all (boo). What is the piece of the puzzle I'm missing?

  • #2
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Background should be

    Code:
    background:url('/bg.png');
    Code:
      <div id="container">    
    		<div id="rightsidebar">
                    <div id="leftsidecontent">
                    </div>
    		</div>
    	</div>
    
    #container				{float:right; width:100%; background:url(../images/contentwide.png) right repeat-y;}
    rightside				{ width: 200px;height:620px; padding-top: 30px; float: right;}
    #content				{ width: 650px; float:right; margin:25px 20px 0 0; float:left;	}

  • Users who have thanked tempz for this post:

    Bagels (07-31-2012)

  • #3
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,903
    Thanks
    15
    Thanked 226 Times in 226 Posts
    This is just plain wrong:
    background:background:url
    should be:
    background:url

    Look on this page for background-shorthand-property for the correct syntax.

    http://www.w3schools.com/css/css_background.asp

  • Users who have thanked DrDOS for this post:

    Bagels (07-31-2012)

  • #4
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks guys.

    I had spent so long messing with various fixed that when I finally got the right one I didn't notice some stupid copy/paste error. Sometimes you just need fresh eyes. Thank you both so very much. Now I can really start adding content.


  •  

    Tags for this Thread

    Posting Permissions

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