미디어 쿼리 + 뷰포트 단위(vw, vh)@media (max-width: 768px) {
.container { font-size: 14px; }
}
max-width, min-width: 너비 기준max-height, min-height: 높이 기준orientation: 가로/세로 방향resolution: 해상도 기준vw, vh: 뷰포트 너비/높이 1%vmin, vmax: 너비·높이 중 작은/큰 쪽 기준.container {
width: 80vw;
height: 50vh;
padding: 2vmin;
}
.box { width: 30%; }
@media (max-width: 1023px) {
.box { width: 48%; }
}
@media (max-width: 767px) {
.box { width: 100%; }
}
🧾 요약: 반응형 웹은 다양한 화면 크기에 따라 레이아웃을 자동 조정해 사용자 경험을 향상시킴.
background-color: lightblue;
background-image: url("이미지주소");
background-size: cover;
background-position: center;
/* 선형 */
background: linear-gradient(to right, lightblue, lightgreen);
/* 원형 */
background: radial-gradient(circle, lightblue, lightcoral);
background: linear-gradient(...), url("이미지주소");
🧾 요약: 그라디언트와 이미지 조합으로 시각적으로 풍부한 배경 표현 가능.
solid, dashed, dotted, double, groove, ridge, inset, outsetborder: 2px dashed red;
border-radius: 15px; /* 둥근 모서리 */
border-radius: 50%; /* 원형 */
box-shadow: 10px 10px 5px rgba(0,0,0,0.5);
text-shadow: 2px 2px 3px rgba(0,0,0,0.5);
🧾 요약: 보더와 그림자를 활용해 요소에 입체감과 강조 효과를 줄 수 있음.
.box {
transition: background-color 0.5s ease, width 0.5s ease;
}
@keyframes example {
0% { transform: translateX(0); }
50% { transform: translateX(100px); }
100% { transform: translateX(0); }
}
.box-animate {
animation: example 4s infinite;
}
animation: colorChange 5s infinite, moveAndRotate 5s infinite;
🧾 요약: 트랜지션은 상태 변화에 부드러움 제공, 애니메이션은 시간 기반 변화 연출
✅ 총정리