Page 1 of 1

Two backgrounds

Posted: Thu Jul 20, 2006 5:31 pm
by miniature
How can I do two backgrounds -
1. At the right.
2. At the left.

??

Thanks,
Yoav.

Posted: Thu Jul 20, 2006 5:41 pm
by MarK (CZ)
one div, second div, both padding and margin set to 0, width and height set to 100%
background set for each of them

that should work i hope

Posted: Thu Jul 20, 2006 6:26 pm
by miniature
OK tnx

Posted: Thu Jul 20, 2006 10:26 pm
by daedalus__
Don't forget to set z-index's.

Posted: Fri Jul 21, 2006 9:12 am
by miniature
Daedalus- wrote:Don't forget to set z-index's.
why?

Posted: Fri Jul 21, 2006 10:11 am
by Chris Corbyn
miniature wrote:
Daedalus- wrote:Don't forget to set z-index's.
why?
Ignore that :P Sorry Daedalus- but that's not needed here. We're *nesting* two identically sized div's, not using CSS positioning ;)

Posted: Fri Jul 21, 2006 10:28 am
by JayBird
You can actually have 2 background images in a <div> like so

Code: Select all

div.test {
	background-image: url(../pix/logo.gif), url(../pix/logo2.gif);
	background-repeat: repeat-y;
	background-position: top left, bottom right;
	height: 200px;
	border: 1px solid #000000;
}
Problem is, it only works in Safari....well, it's not a problem for me because i use Safari :D Another great reason to own a Mac