Forums / General Questions / Hang image outside of main body...

Hang image outside of main body...

Locked

Started by digitalshadow on 14 Dec 2010, 2:04 PM · Views: 1,507

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
14 Dec 2010, 2:04 PM
#1
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Hang image outside of main body...

Hi there, I'm trying to position an image so that it hangs on the left hand side of the site outside of the main body.

So if you imagine your zen cart page, an image is placed behind the site but infront of your background, and part of the image is visible to the left of the site.

What I need to know is how do i position the DIV so that it is behind the body and doesn't mess up the site layout, but just sticks out the side.

You follow? :smile:

14 Dec 2010, 2:16 PM
#2
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Re: Hang image outside of main body...

<div style="position:absolute; z-index:-10; left:-120px; top:60px;"> <img src="/images/store/santa.png" /> </div>

Done it using that, but I would like it so the image position is based on the position of the main content, so even as the window size changes, the image is always the same distance from the main body.

15 Dec 2010, 12:11 AM
#3
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Re: Hang image outside of main body...

someone must be able to help, this is simple code for someone, need the position relative to the main content

15 Dec 2010, 1:29 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Hang image outside of main body...

If you have no positioning on wrapper elements, the html/body (window) will be used as the positioning context. Add to #mainWrapper {position: relative;} and that will be the positioning context for divs contained in it.

15 Dec 2010, 4:28 AM
#6
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Hang image outside of main body...

This might help as an example w w w.c a p j a x.c o m
It's off to the right but you should get the idea.

Skip

• 446F63746F722057686F •