Two backgrounds

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
miniature
Forum Newbie
Posts: 14
Joined: Sun Apr 09, 2006 3:41 pm

Two backgrounds

Post by miniature »

How can I do two backgrounds -
1. At the right.
2. At the left.

??

Thanks,
Yoav.
User avatar
MarK (CZ)
Forum Contributor
Posts: 239
Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:

Post 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
miniature
Forum Newbie
Posts: 14
Joined: Sun Apr 09, 2006 3:41 pm

Post by miniature »

OK tnx
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Don't forget to set z-index's.
miniature
Forum Newbie
Posts: 14
Joined: Sun Apr 09, 2006 3:41 pm

Post by miniature »

Daedalus- wrote:Don't forget to set z-index's.
why?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 ;)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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
Post Reply