Reputation: 15504
i have a web page using a css style file who have this property:
body {
background: #7a9c12 url(images/main_background.jpg) top center no-repeat;
color: #bbb;
font: 12px/14px helvetica, arial,Sans-serif;
}
As you can see this code only puts a background image on the top center on the div body. But, i need a background image in the botton center too of the body tag, how can i do this? Thanks!
Upvotes: 4
Views: 184
Reputation: 15853
With CSS3, you can have multiple backgrounds, separated by commas. See the documentation. e.g.
background: url(banner.png) top center no-repeat,
url(footer.png) bottom center no-repeat;
Upvotes: 1
Reputation: 25685
An option if you're not using CSS3 is to layer the background images on your html
and body
tags:
html {
background: #7a9c12 url(images/main_background_top.jpg) top center no-repeat;
}
body {
background: url(images/main_background_bottom.jpg) bottom center no-repeat;
}
Just make sure you only apply a solid background colour to the html
background property, otherwise you'll overlay the image and only see the body
background image.
Upvotes: 2