Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How can I place an image right next to the mainWrapper?

How can I place an image right next to the mainWrapper?

Locked

Views: 862

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
4 Jan 2010, 4:04 PM
#1
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
413
Plugin Contributions:
0

How can I place an image right next to the mainWrapper?

How can I place an image right next to the mainWrapper without using <div>?
I centered the mainWrapper and would now like to place an image right next to the edge on the outside of the wrapper. The image must be able to stay at the same place regardless of if the user re-sizes or scrolls the window, so I guess I would need to just insert it in /www/www/includes/templates/my_template/common/tpl_main_page.php but how and where exactly?? :lookaroun

4 Jan 2010, 5:47 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: How can I place an image right next to the mainWrapper?

Unless you use a background image, you will need a div or some container for an image. Locating an element next to the #mainWrapper will make it impossible for #mainWrapper to auto-center.

What you might do is add a div just after the #mainWrapper div opening, give it an id like "sideImage", and in the stylesheet add
position:relative;
to #mainWrapper, and a new rule like
#sideImage {position: absolute; top: 123px; left: -123px;}
which will keep the image from occupying space in the layout and make it sit next to #mainWrapper.

5 Jan 2010, 3:45 PM
#3
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
413
Plugin Contributions:
0

Re: How can I place an image right next to the mainWrapper?

gjh42:

Unless you use a background image, you will need a div or some container for an image. Locating an element next to the #mainWrapper will make it impossible for #mainWrapper to auto-center.

What you might do is add a div just after the #mainWrapper div opening, give it an id like "sideImage", and in the stylesheet add
position:relative;
to #mainWrapper, and a new rule like
#sideImage {position: absolute; top: 123px; left: -123px;}
which will keep the image from occupying space in the layout and make it sit next to #mainWrapper.

Amazing! Thanks a lot. That was exactly what I needed! :clap: