본문 바로가기

웹 프로그래밍/css

position: relative, absolute, fixed, static

position 속성은 요소를 배치하는 방법을 지정한다. 

1. relative: 

element가 '처음 생성된 위치'를 기준점으로, top bottom left right으로 위치를 조금씩 수정할 수 있다.

 

2. absolute:

가장 가까운 relative 부모를 기준으로 이동

 

3. fixed:

element가 처음 생성된 자리에 계속 고정됨 (ex. 메뉴바)

 

4.static: 

defalut 값

'웹 프로그래밍 > css' 카테고리의 다른 글

selector, state  (0) 2023.09.02
margin, padding , border  (0) 2023.01.05
박스 display: (block , inline, inline-block)  (0) 2023.01.05
css 작성법 ( id, class )  (0) 2023.01.05
html + css (css 를 html에 추가하는 방법)  (0) 2023.01.05