Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Position something so that it doesn't move?

Status
Not open for further replies.

jbtman

Programmer
Jul 13, 2007
30
I have a site where there is a top banner, nav under that and then the main content. On top of it all there is an image in it's own div, it literally shows on top of the other divs. What I want is for that image to not move, no matter what resolution or if the browser window is shrunk.

Is this possible?
 
The image is placed overlapping 2 divs, in it's own div, and is positioned exactly where it needs to show up. The problem is when I change to a dif screen resolution it moves. Can this be prevented?
 
You will need to rephrase what 'to not move, no matter what resolution or if the browser window is shrunk' means. Say that I position something absolutely 10px from left and 10px from top. That thing does not move at all between different resolutions and always stays 10px from top and 10px from left. However, other things on the page may move, creating the illusion that this item is moving. So, you need to tell us relative to what is your positioned something not supposed to move.

But it is possible as soon as you will figure the above question out.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Sigh, yeah, I guess you are right. The image div needs to be in exact position over the header div and the content div so it fits in where I want it.

Thanks for understanding, I am so new to this!
 
Whoohoo! Got it! I moved it inside one of the divs and then used relative positioning with a negative top value!

Uh, is this the correct way?
 
It works, right? I might be opting for absolute positioning so as to not create a space for this element. Your code should have a space where this image div is supposed to be if it weren't for the displacement via top value.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
It was with the absolute positioning that it appeared to move, ah well, it works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top