🖥️프론트엔드/HTML | CSS | JAVASCRIPT
CSS - 미디어 쿼리
Janger
2021. 11. 29. 07:18
728x90
<meta name="viewport" content="width=device-width, initial-scale=1.0">
/* width under 576px */
@media (max-width: 575px){
body{ background-color: white; }
}
/* Mobile */
@media (min-width: 576px) and (max-width: 767px){
body{ background-color: red; }
}
/* Tablet */
@media (min-width: 768px) and (max-width: 991px){
body{ background-color: green; }
}
/* Desktop */
@media (min-width: 992px) and (max-width: 1199px){
body{ background-color: blue; }
}
/* width over 1200px */
@media (min-width: 1200px){
body{ background-color: orange; }
}
참고:
[반응형웹] 모바일 퍼스트 CSS 작성하기 / 데스크탑 퍼스트
모바일 사용자가 점점 늘어나면서 반응형 브라우저의 중요성이 날로 커지고 있다. 반응형 웹 작업을 할 때에는 CSS 미디어 쿼리가 필수인데, 미디어 쿼리 작성 방법에도 종류가 있다. 어떤 디바
fromnowwon.tistory.com
728x90