Development/CSS

css - position Property(absolute vs relative)

linuxism 2015. 6. 16. 10:27


CSS Syntax

position: static|absolute|fixed|relative|initial|inherit;

Property Values

ValueDescriptionPlay it
staticDefault value. Elements render in order, as they appear in the document flowPlay it »
absoluteThe element is positioned relative to its first positioned (not static) ancestor elementPlay it »
fixedThe element is positioned relative to the browser windowPlay it »
relativeThe element is positioned relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT positionPlay it »
initialSets this property to its default value. Read about initialPlay it »
inheritInherits this property from its parent element. Read about inherit



source - http://www.w3schools.com/cssref/pr_class_position.asp








absolute는 조상요소가 relative가 아니면 fixed와 동일하게 위치됨?