What I want here, is a 400px high div with a background filling the full width and the other div under with another background.These divs should just be the backgrounds, and my content on the page shouldnt affect any of these div's in any way.

The background div's in my case is #förstabg and #andrabg.

I'm not sure if im doing right with this but anyhow a problem occured.

andrabg wich is my second background is not behind my imageslider wich is #slider.

andrabg wich is my second background is not behind my imageslider wich is #slider.

What am I going to do?

If you want multiple backgrounds like that, the trick is to nest divs within divs. Your andrabg div is outside the slider div.

kvnwpts
—
2012-05-01T00:58:15Z —
#3

I did so the #andrabg starts just before the slider, and then the bg starts just where the slider picture is. What i want, as in the website have the background at halfways the sliderpicture.

How do I do that, cause positioning the background dosent make any difference?

ralph_m said:

If you want multiple backgrounds like that, the trick is to nest divs within divs. Your andrabg div is outside the slider div.

ralphm
—
2012-05-01T02:51:06Z —
#4

Sorry, it's not really clear. Could you post an image of what you actually want, or put this up live somewhere?

Stomme_poes
—
2012-05-01T09:11:37Z —
#5

I can see the picture posted in the first post, but other than the two elements labeled there, I don't know who/where all the other boxes are, so I can't see what's going on.

is undermitter the jumping dude pic? and does homebgtile have the fw and the greyish block on it, or is homebgtile just the wallpaper tiled and the fw is logo.png? and is then the grey area a bg for menu? Where is slideshow? What part of the code is the text supposed to be that is sitting at the bottom of jumping dude? is jumping dude actually reaching down to the yellow line?

We could build the code you have now if we had also access to teh images you're using, or you could post something live, so we could see better what's going on.

kvnwpts
—
2012-05-01T10:18:39Z —
#6

I gona tell you, since I cant post live now. :/

body is just a grungy background.

förstabg is just a transparent picture with some circles in it like the website i linked.

andrabg is just the kinda greyish background.

upper is just the holder of #mainlogo & #meny

meny is just a menu background and has nothing to do with the other stuff.

slidercontainer is my container for my #slider, #slidercontainer has a bg wich has neither nothing to do with my problem. (I guess, )

body {

Stomme_poes said:

I can see the picture posted in the first post, but other than the two elements labeled there, I don't know who/where all the other boxes are, so I can't see what's going on.

is undermitter the jumping dude pic? and does homebgtile have the fw and the greyish block on it, or is homebgtile just the wallpaper tiled and the fw is logo.png? and is then the grey area a bg for menu? Where is slideshow? What part of the code is the text supposed to be that is sitting at the bottom of jumping dude? is jumping dude actually reaching down to the yellow line?

We could build the code you have now if we had also access to teh images you're using, or you could post something live, so we could see better what's going on.

kvnwpts
—
2012-05-01T21:09:26Z —
#7

If you dont understand, I just want two different background splitted in halfway of the screen. thats basically it.

TechnoBear
—
2012-05-01T21:17:32Z —
#8

If I understand what you're after, you could make one div the width of your content and apply andrabg to that. Inside that div, make a second one, same width and 400px high and apply förstabg to it. Does that make sense?

kvnwpts
—
2012-05-01T22:28:01Z —
#9

I guess not since the background should be 100% wide.

Right now i have a the #andrabg div before my slider div and at the end. So the background starts just where my slider div starts and ends at the end. I want the background to start halfway my slider picture, But i dont know how to get it there.

TechnoBear said:

If I understand what you're after, you could make one div the width of your content and apply andrabg to that. Inside that div, make a second one, same width and 400px high and apply förstabg to it. Does that make sense?

TechnoBear
—
2012-05-01T22:37:37Z —
#10

kvnwpts said:

I guess not since the background should be 100% wide.

Then set the main background andrabg on body, and make a second div, 100% wide, to hold the förstabg. You've already said you want that div 400px high, but set the height to whatever it takes to get it to end half-way down your slider.

kvnwpts
—
2012-05-01T22:49:07Z —
#11

Oh, im getting confused. Could you take it a bit more detailed. I'm sorry for being a little retarded sometimes, but still, I'm 17 and learning.

TechnoBear said:

Then set the main background andrabg on body, and make a second div, 100% wide, to hold the förstabg. You've already said you want that div 400px high, but set the height to whatever it takes to get it to end half-way down your slider.

kvnwpts
—
2012-05-02T13:23:16Z —
#12

I hope you don't get angry because I don't understand. I would be sooo glad if you could help me.

TechnoBear
—
2012-05-02T13:44:45Z —
#13

No, of course I'm not angry. I was very tired last night and probably not explaining myself very well. I think you're trying to achieve something like this:

(And there's no need to always quote a post when you reply to it - it makes for an awful lot of unnecessary scrolling. :))

kvnwpts
—
2012-05-02T16:54:52Z —
#16

Ill come back with a picture describing exactly how I want it in some hours.

TechnoBear said:

You mean like this?

kvnwpts
—
2012-05-02T18:56:53Z —
#17

Im not sure if this is described enough.

But basically I wanna have my body background image to be all over the site.Two divs with that meets halfway in at my slider picture.

At this picture the green and grey is only showing the divs with my custom background images, but my body background image is a BG thats gona be all over my website. You may think...Why does he have a body background when he have two divs overlapping the body background. One of my div backgrounds is semi transparent, so the body bg and div bg will both be shown.

TechnoBear
—
2012-05-02T19:07:32Z —
#18

That seems to be pretty much what I gave you. Just take the widths off #background1 and #content and they'll stretch the full width.

To deal with the transparency of the top area (green in your picture) you'll need to add a corresponding transparent area to the top of the background image for #background1.

kvnwpts
—
2012-05-02T20:19:11Z —
#19

I copied your code, but the two divs dosent meet in the middle of the sliderpic, it does in the picture you submitted, but not in code.

TechnoBear said:

That seems to be pretty much what I gave you. Just take the widths off #background1 and #content and they'll stretch the full width.

To deal with the transparency of the top area (green in your picture) you'll need to add a corresponding transparent area to the top of the background image for #background1.

TechnoBear
—
2012-05-03T10:41:14Z —
#20

OK, I think we have two problems here. The first is that you haven't entirely understood how my code works, perhaps because I haven't explained it very clearly. The second is that all through this thread, I've been guessing at what you want and what you're trying to achieve, because you haven't given me full information.

In my code, there is an x and y repeating background image on <body>. (i.e. the image repeats horizontally and vertically.) Inside <body> is the div #background1, which also has an x and y repeating background image. This div has a min-height of 800px set. Nested inside this div is another, #content. It has a 400px high background image, which is set to repeat-x only. So no matter how tall the div gets, the background image will only ever cover the top 400px. The image (standing in for your slider) is centred over the join between the two backgrounds. If you're using different sizes of image/backgrounds, then you'll need to play about a bit to get things lined up, but the theory is simple enough.

You added in another complication yesterday, when you mentioned that you wanted the body background to show through the top background (which is applied to #content). There are various ways to do this, depending on the kind of images you're using. If you're using a fixed-size, no-repeat image for the lower background portion (on #background1), then you can use background-position: 0px 400px; to position it below the other background. If you're using a repeating image, you'll need to construct it in such a way that it has a transparent area at the top, to lie underneath the top background. There may be other ways to do it, but as I don't know what else you're planning to put on the page, I'd be guessing again.

Can you work out from that how to adjust my code to fit your images? I can't be of much more help just now, because

but the two divs dosent meet in the middle of the sliderpicdoesn't give me much clue as to what's actually happening. :)