천진난만 코딩 스토리
22. Friends 화면 만들기 (html,css - component 3) 본문
1) 기본 component 수정해서 사용하기
작성했던 코드는 현재 페이지에서 사용할 코드와 조금 다름.
지금은 subtitle이 필요없기에
주석처리하여 숨겨둠.
현재 페이지에서 사용할 avatar의 크기는 좀 더 크므로
user-component__avatar--xl 을 추가로 작성하고
user-component__avatar--xl 을 불러와서
크기를 더 키워줌.
기존 크기보다 이미지가 커진 것을 볼 수 있음.
2) padding 맞추기
header와 이미지의 padding을 맞춰보도록 하겠음.
물론 맞추지 않고 개별로 따로따로 padding이나 margin을 주어도 됨.
screen-header에 원래 작성되어있던 padding의 값인 25px를
variables.css 파일의 root에
--horizontal-space: 25px 를 하여줌.
원래 있던 padding 값에
--horizontal-space 를 적어줌.
html 파일에 main 태그를 입력하여
friends-screen 이라는 class를 줌.
main 태그 사이에 comopnent 코드를 넣어줌.
friends-screen에
--horizontal-space인 padding을 넣어주면 됨.
header의 Friends 와 이미지의 앞 padding이 일치하는 것을 볼 수 있음.
3) friends display 와 component 간격 넓히기
friends display 와 component 의 사이를 넓혀주기 위해
friends-display-link 의 밑에 margin을 줌.
component가 아래로 내려간 것을 볼 수 있음.
'노마드코더 > 코코아톡 클론코딩' 카테고리의 다른 글
24. Chats 화면 만들기 (html,css - Chats 화면 1) (0) | 2022.11.16 |
---|---|
23. Friends 화면 만들기 (html,css - component 4) (0) | 2022.11.13 |
21. Friends 화면 만들기 (html,css - component 2) (1) | 2022.11.12 |
20. Friends 화면 만들기 (html,css - component 1) (1) | 2022.11.12 |
19. Friends 화면 만들기 (html, css - friends display link) (0) | 2022.11.11 |