IMO the CSS guide on relative/absolute positioning is not clear and needs changing


#1

I am new to CSS and I've been scratching my head trying to understand the difference between relative and absolute positioning because the examples provided do not clearly illustrate it. It wasn't until I had to watch this video that it is clear, because it shows in the case of absolute positioning how the box moves relative to html, and in the case of relative positioning it moves relative to the other box.

The code academy examples do not do this. Instead these examples want you to change margin-left of the inner div while the outer div has position: absolute. So there is no clear difference between positioning having used absolute or relative.

IMO what instead should be done is remove the absolution positioning from the outer div and instead of doing margin-left do left instead.

Like this:

https://jsfiddle.net/w9bnytmq/#&togetherjs=bLrIxs4T3z


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.