transform: scale(1.5);
- animation 만들기
@keyframes ani-motion { 0% { transform: scale(1); } 50% { transform: scale(1.2) rotateY(45deg); } 100% { transform: scale(1); } }
- animation이 2단계일경우, 0%와 100%이다.
- animation이 4단계일경우, 0%, 30% 60% 100%이다.
- 결론 0~100%를 단계별로 쪼개면 된다.
- animation 적용하기
.coffee-img { animation: ani-motion 1.2s ease infinite; animation-delay: 1s; will-change: transform; }
- animation: animation이름 변화시간 변화방식 추가설정;
- 추가 설정에는
infinite
와forwards
가 있다.
infinite
란? animation효과를 계속 반복시킨다. 없애면 1번만 재생하고, 끝난다.forwards
란? 효과는 원래 animation이 멈추면 처음 모습으로 되돌아가는데forwards
이걸쓰면 마지막 모습으로 머무르게 된다animation-delay: 1s;
란? 1초 있다가 animatioin이 발생한다.
- animation 적용하는 것보다 아래에 있어야한다.
will-change: transform;
란? 브라우저에게 transform이 미리 변하는 것을 알림으로써 고퀄리티가 된다.
- 사라지는 animation 만들기
.big-div { animation: hidden 1s ease forwards; } @keyframes hidden { 0% { } 100% { opacity: 0; visibility: hidden; } }
@media screen and (min-width: 800px) and (max-width: 1000px) { img { opacity: 0.5; /*css속성부여한다.*/ } }
- 윈도우 창의 폭이 800px~1000px이 되면, 이미지가 반투명해진다.
- (괄호)안에 넣을수 있는 조건들
- 세로모드 orientation: portrait
- 가로모드 orientation: landscape
- 세로모드가 되면, 이미지의 배경색이 바뀌거나 하는 식으로 css조정가능
<body></body>
의 맨 밑에 👇 복붙한다. 주의사항, 👇 밑에 html작성하지마라<script src="https://kit.fontawesome.com/f0be26917b.js" crossorigin="anonymous"></script>
color: toamto;
font-size: 20px;
google font검색한다.
원하는 스타일을 찾고 select this 버튼을 누른다
main css파일을 만들고, 맨위에 @import~ 를 복붙한다
<link />
를 이용해서 main css파일과 html을 연결한다.
body{ }
안에 font-family:~
복붙한다.
position: relative;
를 설정한다.z-index: 1;
,기본값은 0이다.flex-direction:
이용하는 방식order:
이용하는 방식div를 크게 만든다. width: 100vw;
height: 100vh;
다른 div들을 가려야하므로 position: absolute;
top: 0;
bottom: 0;
을 설정한다.
뒤에 가려져있던 것이 클릭되게 하고싶다. visibility: hidden;
.green:hover a { opacity: 0; }
<div class="green"> <a href="https://nomadcoders.co/" target="_blank" class="nomad-link" nomad coder</a> </div>
- green div에 마우스를 올리면 green div안의 a의 모습이 사라진다.
.icon { transform: translateY(-70px); animation: show 1s ease forwards; } @keyframes show { 0% { } 100% { transform: none; } }
- 초기 위치를
transform:
을 이용하여 화면 밖으로 벗어나게 하기- animation 만들 때, 맨 나중모습에
transform: none;
을 이용해서 초기에 화면 밖으로 벗어나게 만든 설정을 없애서, 나타날 수 있음
@import "파일명/폴더명.css";
입력