I am having troubles using css to place two background images in a div. The first images is the top of a box that is transparent and has rounded edges. The next is just 10px tall of the body of the same image without the rouded corners. I want to have the 1st image at the top and the next image right after with it repeating on the y axes untill the bottom of the page regardless of content. Can someone help me with the css. Every time i try it, the second background image covers up the first image and doesn't repeat unless there is content. thanks
Asked
Active
Viewed 100 times
1 Answers
0
You have to use the height property of the div to deal with this. If you dont set the properties, it will wrap the images one top of the other which is the problem you facing now.
Refer the following link you will see multiple options of how to do this.
Can I have multiple background images using CSS?
hope this helps..
-
Ok when i added the first image with the following css code everything was looking good but when i added the second image both images are not showing? `.content{ height:100%; width:822px; margin-left:auto; margin-right:auto; background-image:url(../images/body/main_top.png), url(../images/body/main.png); background-repeat:no-repeat, repeat-y; }` Any ideas? – John Marsh Oct 31 '12 at 17:26
-
try this- one main div with page width and height-inside this main div do 2 child divs A,B. A for the rounded corners B for body. set the fixed height for A and leave the B height as Auto. – pibcat Oct 31 '12 at 17:39
-
like following: