일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 로켓펀치 #취준컴퍼니 #취업 #일상 #취준생
- 99클럽
- 다중 catch 블록
- til
- 코딩테스트준비
- 예외클래스
- try-catch-finally 블록
- 실행 예외
- 일반 예외
- throws 키워드
- 예외
- 예외 처리
- 개발자취업
- 항해99
Archives
- Today
- Total
innn
프로필 사진과 상태메시지 만들기 본문
메인 내용이었던 이번 프로필과 상태 텍스트는 모두 <div>로 만들었다.
특히 큰 <div> 하나에 들어갈 2개의 목록(현재는 하나만 만들어진 니꼴라스와 다른 목록 하나)이 있고
그 2개의 목록 중 하나인 니꼴라스 프로필 div에는 또다시 img(사진) div와 text(상메) div가 있었다.
두 div를 하나의 라인에 놔야하니 당연스럽게 display;fiex;를 주었고
제일 큰 div 중 첫번째 자식에게만 해당하는 내용의 css를 선택하기 위해
:first-child 선택자를 사용했다.
오늘 적용한 뼈대 html 코드는 아래와 같다.
<div class="user-component">
<div class="user-component__column">
<img src="https://avatars3.githubusercontent.com/u/3612017"
class="user-component__avatar" />
<div class="user-component__text">
<h4 class="user-component__title">Nicolas</h4>
<h6 class="user-component__subtitle">this text whatever</h6>
</div>
</div>
<div class="user-component__column">
</div>
</div>
오늘 건드린 코드는 밑줄표시.
css는 이러하다.
.user-component, .
user-component__column:first-child {
display: flex; align-items: center;
}
.user-component__avatar {
width: 70px; height: 70px; border-radius: 27px; margin-right: 20px;
}.
user-component__title {
font-weight: 600; font-size: 22px;
}.
user-component__subtitle {
margin-top: 8px;
color: rgba(0, 0, 0, 0.5);
font-size: 17px;
}
새로 알게 된 것
1. html 코드 작성시 user-component*2 로 입력할 경우
클래스가 유저 컴포넌트인 div가 2개가 만들어진다.
2. 반복되는 것들은 component로 만들어서 반복해서 사용할 수 있도록 한다
'FE > HTML CSS 자바 스크립트' 카테고리의 다른 글
const와 let의 차이와 (변수의) 목적 (0) | 2022.08.29 |
---|---|
자바스크립트의 가장 기초적인 데이터 타입(문자, 숫자) (0) | 2022.08.29 |
<a> 태그 = 인라인 요소 = 높이 너비 없다!!! (0) | 2022.08.29 |
친구목록 창 헤더 만들기 (허무한 실수를 곁들인) (0) | 2022.08.28 |
네비게이션 바 고정시키기 (0) | 2022.08.28 |