I got a website and im trying to get 2 images in the background. The code im currently using is this: body { background-image:url('BGLEFT.jpg'); background-repeat:repeat-y; background-position:left; } Someone on another forum told me if I also added this code, it would add the the right border, but it did not work. html { background-image:url('BGRIGHT.jpg'); background-repeat:repeat-y; background-position:right; } Is there any way that I can add a second BG image to the website?
you can use a wide background(bgleft.jpg on left and bgright.jpg on right). or you have to use a new div in body.
read this tutorial: http://www.website-tricks.com/htmlcss/different-backgrounds-on-the-two-sides-of-the-content
Interesting I was thinking about whether you could place a background image on the HTML element the other day, I guess it's not possible then or not supported for that matter... Ah well I just tested it, and it seems placing a background on the html, renders placing a background on the body element totally useless for some reason. Even if the html background is set to no-repeat and the body background is positioned somewhere else or has a background colour set to it, it cannot be seen ! For some reason adding a background to the html adds a mask over the body element completley with regards to backgrounds, so I guess it shouldn't be messed with unless someone knows otherwise. ..Oh but wait this article, from this year, and a usual reliant source, claims the opposite to what I said, and says it is possible? But I literally copied and pasted their example, and it doesn't work for me? No wait again....I had no content in my body, doh, my bad. It does seem at this current moment seem to work correctly in old/new browsers, and a possibly clever way to avoid one of those extra sandbagging div's we need for backgrounds. So ignore like the 2nd and 3rd paragraph of this post, but i'll leave them in there so you can all see my story for tonight .
You can you this for general background: body { <---- best for main background background-image:url('BGLEFT.jpg'); background-repeat:repeat-y; background-position:left; } and then to have another background:<----- best for header part background. (my sample code: http://alfieindesigns.ucoz.com/fs/index.html) .header { background-image:url('bg2.jpg') top center no-repeat; position:relative; height:200px; }
You should be able to add a second background, as long as you find the right coding and remember to ignore the div.
Placing ANY formatting on HTML more than height:100%; for 100% min-height layouts is usually a plan for disaster given the completely inconsistent way the HTML 'element' is handled - do yourself a favor and just slap in an extra wrapping DIV.