코코아톡 클론코딩 하면서 알게된 것들 정리 하는 느낌?
nav>ul>li*4>a
입력
<nav>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</nav>
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");
@import "reset.css";
@import "variables.css";
/* Components */
@import "components/status-bar.css";
@import "components/nav-bar";
box-sizing: border-box;
-> 사각형 width의 절반을 border-radius의 값으로 쓰면 된다.
width: 30px;
height: 30px;
border-radius: 15px;
-> 블럭이나 요소가 어떤 상황일 때 다른 스타일을 가져야 한다면 modifier를 사용한다.
<img src="#" class="user-component__avatar" />
<img src="#" class="user-component__avatar user-component__avatar--xl"/>
.user-component__avatar {
width: 70px;
height: 70px;
border-radius: 30px;
margin-right: 20px;
margin-bottom: 20px;
}
.user-component__avatar--xl {
width: 80px;
height: 80px;
}
-> 이미지 크기 조정을 font-size
를 활용해서도 할 수 있다.
.find-icons__icon i {
font-size: 30px;
}
<div class="divider"></div>
.open-post__members .divider {
width: 1px;
height: 15px;
background-color: rgba(0, 0, 0, 0.2);
margin: 0 5px;
}
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
box-sizing: border-box;
width: auto;
-> z-index는 기본적으로 div가 있는 위치가 맨 앞에서부터 몇 번째인지를 나타낸다. 즉, layer의 순서가 몇 번째인지를 나타내는 것 (position-fixed 느낌)
#chat-screen .status-bar {
z-index: 2;
}
-> 순서 설정, flex children에게만 적용
.message-row--own .message__bubble {
order: 1;
}
.message-row--own .message__time {
order: 0;
}
#splash-screen {
background-color: var(--yellow);
position: absolute;
height: 100vh;
width: 100;
top: 0;
}
Width: 100vw
: 화면 넓이의 100%를 의미Height: 100vh
: 화면 높이의 100%를 의미-> 애니메이션의 마지막 속성이 유지된다.
animation: hideSplashScreen 0.4s ease-in-out forwards;
Ex)@keyframes hideSplashScreen {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
-> 애니메이션이 시작하지 않고 설정시간동안 멈춤
animation-delay: 2s;
-> github에서 특별한 이름이 붙여진 branch를 가지고 있으면 공짜로 Static 호스팅을 할 수 있도록 해준다.
cf) Static website : HTML, CSS, JavaScript로만 이루어진 사이트를 의미, front-end만 가능, back-end는 다룰 수 없음
1) gh-pages 브랜치 생성 (저장소는 public 이어야 함)
2) publish branch 클릭
3) repository 들어가서 Environments -> GitHub-pages 클릭
4) view Deployment로 들어가기
출처
9. margin-right: auto? : https://oh-potato.tistory.com/7?category=1213426