How does Position: Relative work in Css, i still don't know that after 1 year of college....

+2 Oussama Fahchouch · June 27, 2015
Can someone please explain in details how position relative works in css?

I am really struggling with that..

Position absolute is easy.., but what about relative?? I don't understand the logic with relative.., it's like it haves it own will if i give it a relative position....

Please someone?

Post a Reply


Oldest  Newest  Rating
0 Oussama Fahchouch · June 28, 2015
But relative to what?

lets say we have some html code


    <div id="container">
        <div id="formBox">
            <div id="form">
        <div id="formDescription">


Let's say they are all relative to eachother?

How will they be positioned according it's parent and child scope?
+1 Jonas Meise · June 28, 2015
container will be positioned relative to body.

formBox and formDescription will be positioned relative to container.

form will be positioned relative to formBox.

someone correct me if I am wrong ^^
0 Oussama Fahchouch · June 28, 2015
If it's that simple like Jonas explained to me... then thank you..
  • 1

Other Programming Languages


I think it is pretty obvious what this section is for.

Bucky Roberts Administrator