...

View Full Version : Background for Div not rendering



Bagels
07-31-2012, 07:20 PM
I'm having a problem getting the background to render on a container div.



<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?

tempz
07-31-2012, 07:31 PM
Background should be



background:url('/bg.png');




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

DrDOS
07-31-2012, 07:36 PM
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

Bagels
07-31-2012, 08:03 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum