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:Relative .....relative to what???

Status
Not open for further replies.

Jakobud

Technical User
Mar 9, 2001
51
US
Okay, I obviously understand the difference between absolute and relative. But when using position:relative to position something with CSS...where do you specify what you are positioning relative to? 'Relative' means 'with respect to something else'. So where in the code do you specify it? I've experimented a bit with this but can't figure out what's it's doing. Like if I wanted to position an image relative to a different image, how would I do that?

While I'm at it, I have one more quick question: If I have some images in a table, can I absolutely position them WITHIN the table? Using the position:relative flag basically disregards the table at all...

Thanks for the help everyone.

Jakobud
 
'Relative' means with respect to parent element or an element that was set prior to the one you deal with.
Both relative and absolute positioning options take the element out of the "normal" content flow. No surprise that it disregarded a table in your attempts.
If you want to position an image relative to a different image, one example - the most simple one - is just put two <img> tags next to each other. The second will be relative to the first one.

I recommend you to find some good tutorial about html positioning because it's an endless story.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top