Link to home
Start Free TrialLog in
Avatar of movieprodw
movieprodw

asked on

CSS Possition, Offset DIV 180px to the right of center

I need to offset a div 'bannerAd' 180px to the right of center.

Every time I try to do it its looks right then I open the widow a little more and it changes.

The bannerAd div is 160px if that matters

I would love any help, thanks.
Avatar of ryangiglio
ryangiglio

How is the div positioned?

position:absolute is in relation to the browser window, so it would change when you resized the window.

position:relative is in relation to the element's container, so unless your entire page rearranges when you resize the window, it should stay put.

If that doesn't help, maybe you could post the CSS and we could look for something a little more complicated.
Avatar of movieprodw

ASKER

Well its a two column CSS setup and I have set the right margin 180px and I have the new banner that I setup and I would like to just stick it on the edge rather then rebuilding a 3 column design.
ASKER CERTIFIED SOLUTION
Avatar of James Williams
James Williams
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Apologies you can get rid of everything else in the code but .
 
<div style="position:absolute;left:180px;top:22px;width:161px;height:161px;z-index:256" title="" id="Layer1">
Banner HERE
</div>
 
But do place it HERE
</body>
</html>
 
Selvol
That did not work, it does not move with the page when its opened larger in the browser.