What is a media query in CSS?

Subh Prakash Singh
Invent the Future
Media queries in CSS are used to apply different styles based on the device's characteristics, such as screen width, height, or orientation. This allows for creating designs that adapt to various screen sizes, enhancing the user experience across devices. For example, @media (max-width: 768px) { body { font-size: 12px; } /* Smaller text on mobile devices */ }