📖 최성일, ⌈Do it! 인터랙티브 웹 페이지 만들기⌋, 이지스퍼블리싱, 2021
article svg {
width: 100%
}
article svg path {
fill: transparent;
stroke: red;
stroke-width: 2;
/* 1420 : 가시 영역의 path 전체 길이 */
stroke-dasharray: 1420;
stroke-dashoffset: -1420;
transition: all 3s;
}
article:hover svg path {
stroke-dashoffset: 0;
}
article {
width: 200px;
height: 200px;
background: pink;
margin: 100px auto;
}
@media screen and (max-width: 900px) {
article {
background: orange;
}
}
@media screen and (max-width: 400px) {
article {
background: aqua;
}
}
CSS에서 미디어 쿼리를 이용해 화면 너비에 따른 반응형 웹 페이지를 구현해 보았다. 플렉스박스가 항상 헷갈리기 쉬운 부분이었는데, 전부터 알고 있던 플렉스박스 학습 게임으로 한 번 더 복습하며 기본기를 다지는 시간을 가졌다.