반응형

티스토리챌린지 11

CSS pseudo selectors / first-child & last-child

pseudo selectors: 좀 더 세부적으로 엘리먼트를 선택해 주는 것!   기본 코딩DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 50px; } div { width: 300px; height: 300px; background-color: wheat; position: relative; } style> head> body> div>div> div>div> div>div> div>div> div>div> div>div> body>html>    결과  pseudo selectors 사용하기 (first-child & last-child)DOCTYPE html>html ..

2. CSS 2024.11.27

CSS position relative 사용해서 div 박스 옮기기

position relative 사용하기  기본 코딩DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 50px; } div { width: 300px; height: 300px; background-color: wheat; } .green { background-color: teal; height: 100px; width: 100px; } style> head> body> div> div class="green">div> div> body>html> (body: div안에 div 만들기)  결과 여기서 초록색 div를 아주 조금만 옮겨보자.DOCTYPE html>html lan..

2. CSS 2024.11.26

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

CSS inline-block 태그 사용하기

inline-block은 1. 브라우저가 block으로 인식함.2. 높이를 가질 수 있음.3. 사방에 margin도 가질 수 있음.4. 바로 옆에 다른 요소가 올 수도 있음.5. but, 반응형 디자인을 지원하지 않는다.DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { margin: 20px; } div { display: inline-block; width: 50px; height: 50px; background-color: teal; } style> head> body> body>html>     결과

2. CSS 2024.11.19

HTML에 CSS 를 추가하는 방법

방법 1같은 HTML 파일에 HTML 코드와 CSS를 코드를 놓는 방법1-1. style 태그 사용 (head 태그 안에 있어야 함)1) html 태그 안에 head> body> header> h1>The Nick Timesh1> header> main> address>123 Road Altavistaaddress> main> footer>© 2024.NNfooter> body>html>       ✅ 방법 2CSS와 HTML을 분리시키는 방법1-1. 태그 사용1) style.css 파일 만들기 2) link 태그로 연결해주기DOCTYPE html>html lang="kr"> head> title>Home - My first website.title> head> body> header> h..

2. CSS 2024.11.11
반응형