I read that the position property uses the first parent it finds that is not static to position from. The website I read this off of was codeacademy, and so I decided to test this. I have the following HTML:
<link rel="stylesheet" type="text/css" href="styles/index.css" />
<div id="outer"><div id="inner"></div></div>
So there is an outer div and an inner div, I set the outer div to absolute so that I can test absolute first. I then have the following CSS:
border: 2px solid black;
Now this site told me to use margin-left to position it. So I followed what the site showed me, and I set outer to absolute. I then set inner to absolute also, and made the margin go 200px from the left. Now absolute is supposed to use the first parent that is not static, and so I decided to test this and remove the position:absolute from the outer scope. I did this and the styling did not change, which I found quite awkward since the site told me that it would be positioned relative to the first parent that was not static. The next part told me relative will position based on where it would be when static, and this to my amazement did not function like they said, and functioned just like absolute did. So I'm confused at this point, and have no clue why this does not work. So I came here to ask how does position work, and is this site correct with the results?
tl;dr : Read it, and quit being lazy.