미디어 쿼리(Media Query)란?

<!DOCTYPE html>
<html lang="ko">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=3.0">
	<title>Document</title>
	<style>
		div {
			width: 300px;
			height: 300px;
		}
		@media (max-width: 500px) {
			div {
				background-color: blue;
			}
		}
		@media (min-width: 501px) and (max-width: 1000px) {
			div {
				background-color: red;
			}
		}
		@media (min-width: 1001px) {
			div {
				background-color: black;
			}
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

뷰포트가 1001px 이상일 경우

Untitled

뷰포트가 501~1000px일 경우

Untitled

뷰포트가 500px 이하일 경우

Untitled