w3.css
일반적인 장치 중단점
일반적인 장치 중단점에 미디어 쿼리를 사용하는 방법을 알아보자.
일반적인 장치 중단점
높이와 너비가 다른 수많은 화면과 기기가 있으므로 각 기기에 대한 정확한 중단점을 만드는 것은 어렵다. 간단하게 하기 위해 다섯 가지 공통 그룹을 타겟팅할 수 있다.
1단계) HTML 추가
/* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px) {...} /* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px) {...} /* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px) {...} /* Large devices (laptops/desktops, 992px and up) */ @media only screen and (min-width: 992px) {...} /* Extra large devices (large laptops and desktops, 1200px and up) */ @media only screen and (min-width: 1200px) {...}
기본 예시
예제 보기참고
W3C School - Typical Device Breakpoints