<!DOCTYPE html>
<html>
<head>
<style>
body {
background: lightblue;
}
@media (max-width: 600px) {
body {
background: pink; /* Changes background on small screens */
}
}
</style>
</head>
<body>
<h2>Resize the browser window</h2>
</body>
</html>
Explanation:
- Media queries let you apply styles for different screen sizes (used in responsive design).
Leave a Reply