1 reply [Last post]
soniclnd
Offline
Regular
Last seen: 16 years 37 weeks ago
Joined: 2005-01-06
Posts: 29
Points: 0

is there any way of absolutely positioning an object accoriding to its parent div and not the body?... i can't seem to find the answer...

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 1 day ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

absolute positioning

you need to create a positioning context for the parent. you do that by giving it a "position:relative".

e.g.

#parent {position:relative}
#child {position:absolute; left:100px; top: -60px}