[실습]Gentle Moster1

hameee·2022년 9월 29일
0

실습

목록 보기
4/5

<원본>



<작업본>




<차이점>
작업본: header에 position: fixed를 주어서 고정 함

<참고>
1. html에 동영상 넣기
https://www.codingfactory.net/11877

2.
position: fixed를 주면 width가 자동 계산 되므로 width: 100% 같이 써줌(위에 메뉴 만들 때 많이 씀)

3. a 태그, button 태그
<button><a>~~</a></button>
이어야 함
이유: a 태그의 padding까지 버튼으로 인식해야 하기 때문
주의점: a태그에 display:block을 주어 padding top, bottom이 먹도록 한다.

4.
header에 position: fixed
main에 position: relative
를 주었는데 header가 가려짐

hearder에 z-index: 9999;
main에 padding-top: 72px;(header의 height)를 줌

해결은 됐지만 맞는 방법인지는 모르겠음

5.p와 div의 차이점은 무엇일까
p로 버튼을 묶었더니 padding이 안먹음
div로 바꿨더니 padding 먹음
(버튼 만들 때)

6. 버튼 안에 글씨 수직 중앙 정렬 하기
line-height를 버튼 height 만큼 줌


깃허브:
https://github.com/HAMPAGE/practice/tree/main/gentlemonster

0개의 댓글