Reputation: 79
I got a quick question and hope the answer is quick too. How do I make my background to repeat itself throughout the page? I have tried css repeat, it does not work for some reason.
#main_container{
background:url(../images/cb.jpg) top left repeat;
margin:0 auto;
padding:100px 0 150px 0;
z-index:9999;
body{
background-color:#000;
color:#fff;
padding:0 0 0 0;
margin:0 0 0 0;
width:100%;
display:table;
overflow-x:hidden;
position:relative;
}
Upvotes: 0
Views: 674
Reputation: 7491
The problem you see is because your #main-container doesnt fill the full page, you need to extend it for the full height of the page. Why are you using
body { display: table }
in your css? I'd remove that since it could confuse some browsers and shouldn't make any sense...
An easy workaround would be to put the background image in the body
tag instead if that is an option for you?
Otherwise you could always add css to your #main-container:
#main_container { position: absolute; top: 100px; bottom: 0; margin: 0 auto; }
and keep your body { position: relative; }
Upvotes: 1
Reputation: 299
You could use background-repeat
:
#main_container{
...
'background-repeat:repeat;'
}
It should work on your browser if your not using netscape or smthn like that ^^
Upvotes: 0