I have a question: Does CSS code allow you to have two backgrounds in one page/ module? For example, one background is fixed at the top and the other is repeated throughout the page.
And if it does, what should I write to make such an effect, or what tutorial should I follow?
Thanks for answering
Two backgrounds in one page?myspace games
i don't think this can be done as a body background-image... but you could make 2 divs, one on top of page, and one below, and set different backgrounds for each... not sure if you mean you want the second image to also be under the fixed image... this example won't do that, if that's what you wanted, use your repeating background as the body background-image, the make a div and place your fixed image on it, and position it where you want...
good CSS tutorials here:
http://www.w3schools.com/
%26lt;html%26gt;
%26lt;head%26gt;
%26lt;style type="text/css"%26gt;
div.divtop {
width: 100%;
height: 50%;
background-image: url("top-background.jpg");
background-repeat: no-repeat;
background-position: center center;
}
div.divbottom {
width: 100%;
height: 50%;
background-image: url("bottom-background.png");
background-repeat: repeat;
}
%26lt;/style%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;div class="divtop"%26gt;
top content here
%26lt;/div%26gt;
%26lt;div class="divbottom"%26gt;
bottom content here
%26lt;/div%26gt;
%26lt;/body%26gt;%26lt;/html%26gt;
Two backgrounds in one page?big brother myspace myspace.com
As far as i know you cant use two backgrounds. You could try inserting an image and aligning it at the top of the page while having the other repeating.
The way i would get the effect you are after is to create a div e.g.
#topBg{
background-image:"images/bgtop.jpg";
background-repeat:"no-repeat";
background-position:top;
width:something;
height:something;
}
This div places the first image at the top of the page.
Then create a second div that will go after this one which has the repeating background.
#background{
background-image:"images/backgound.jpg...
background-repeat:repeat-y;
width:something;
} Do not specify a height as you want the image to repeat itselt.
In the html insert each div after one another e.g
%26lt;div id:"topBg"%26gt;%26lt;/div%26gt;
%26lt;div id:"background%26gt;Content goes here%26lt;/div%26gt;