클래스: CSS Essential Training

전체 클래스 보기

업계 전문가가 강의하는 클래스 23,500개를 수강하세요.

The position property

The position property

- [Presenter] The position property is a technique used to position elements by changing the flow of the document. It has five values, static, relative, absolute, fixed, and sticky. The default position for elements is static, which means they are not positioned. For the other values, the box offset properties, top, right, bottom, and left must also be used to specify the placement of the positioned elements. Let's use a code pen example to see how these position values work. Starting with relative positioning, scroll down to the relative class and uncomment the position relative style. We won't see any changes yet because relative is the only positioned element that stays in the normal layout flow. So none of the surrounding elements will be affected either but all positioned elements can be moved using the offset properties. A top value of 20 pixels will offset the element 20 pixels from the top of its current…

목차