반응형

2024/11/24 3

CSS position fixed 사용하기 2

DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 20px; } div { width: 300px; height: 300px; background-color: teal; } #different { top: 5px; left: 200px; position: fixed; background-color: wheat; width: 350px; } style> head> body> div>div> body>html> top, left, right, bottom 이라는 프로퍼티 중에서하나만 수정해도 노란색 div는 초록색 div 위로 가게 되어 있다.(더 이상 block이든 margin..

2. CSS 2024.11.24

CSS position fixed 사용하기

position: fixed--> 그 자리에 계속 위치해 있게 하는 것   1. DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 20px; } div { position: fixed; width: 300px; height: 300px; background-color: teal; } style> head> body> div>div> body>html>     결과 스크롤을 계속 내려도 div 박스가 계속 그 자이레 위치해 있다. postion: fixed; 를 적용하면 가장 위에 있는 레이어가 된다   2.DOCTYPE html>html lang="kr"> head> title..

2. CSS 2024.11.24
반응형