1. 미디어 타입 (media type)
- all: 모든 미디어에 사용합니다.
- print: 문서를 인쇄하거나 화면에 미리보기를 표시할 때 사용합니다.
- screen: 테스크톱 모니터 화면 문서표시 할 때 사용합니다. (웹 브라우저는 모두 여기 해당)
2. 미디어 서술자 (media descriptor)
- 논리 키워드
1. and: 모든 조건이 만족해야만 적용됩니다. ( 예: (color) and (max-width: 800px) )
2. not: 모든 조건이 맞으면 적용됩니다. ( 예: not (color) and (max-width: 800px) )
3. only: 미디어 쿼리를 이해하지 못하는 브라우저가 stylesheet를 사용하지 않게합니다.
-그 외
width, min-width, max-width, device-width, min-device-width, max-device-width 등
- 예시
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
728x90
'Web > CSS' 카테고리의 다른 글
[CSS] table td tr 간격 추가하기 (0) | 2023.06.20 |
---|---|
[CSS] div 위아래 수직정렬 (0) | 2023.03.30 |
[CSS] 리스트 스타일링 ( ul, li ) (0) | 2023.03.23 |
[CSS] 알아두면 좋은 참조 사이트 (0) | 2022.12.29 |
CSS 밑줄( _, underscore) 또는 빼기(-,hyphen) 의미 (0) | 2022.09.01 |
댓글