Relative vs absolute?


#1


I want to ask why there are same results when I code relative and absolute?


#inner {
	height: 75px;
	width: 75px;
	background-color: #547980;
    position:relative;
    margin-left:200px;
}
#inner {
	height: 75px;
	width: 75px;
	background-color: #547980;
    position:absolute;
    margin-left:200px;
}


#2

Was discussed here:


#3

@pascal456 The simplest explanation I can give you is that relative and absolute are used to describe the object's position compared to the exact center of the screen. "absolute" refers to the exact center, while "relative" means that the object is located somewhere other than dead center.


#4

ya, thx.
but my answer was reffering to @mike850920's question :wink:


#5

you can check these too
http://stackoverflow.com/questions/10426497/position-relative-vs-position-absolute

https://developer.mozilla.org/en-US/docs/Web/CSS/position


#6

I was struggling with this too, as the example in the course does a poor job of demonstrating the differences. After some googling, I found this which was very helpful. However, it is disheartening to learn that people have been complaining about this section for at least three years and codecademy has not tried to improve it.


#9

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