Media queries can go far beyond width and height, accessing user preferences for accessibility features and theme colors. Using media queries to make layout adjustments is a great start to a responsive design, which builds on these features and more. Master CSS media queries and @media rule to create responsive websites. Learn syntax, breakpoints, common patterns, and advanced techniques with practical examples. CSS media query is a CSS rule that allows us to apply different styles to the webpage depending on the user's device or screen size. The following diagram shows how the layout is changed for various user devices. The styles are applied based on the characteristics of the user's device or viewport. A CSS media query is used to apply different styles based on the device's characteristics like screen size, orientation, or resolution. This makes your website responsive, ensuring it looks good on all devices, including desktops, tablets, and smartphones.