What is the main purpose of media queries in CSS?
- To add multimedia elements like images and videos
- To apply different styles based on user interactions
- To change the color scheme of a webpage
- To modify the layout and design of a webpage based on the device's characteristics, such as screen size and orientation
Media queries in CSS are primarily used for creating responsive web design. They allow web developers to adapt the layout and styling of a webpage based on the characteristics of the device, such as screen width, height, and orientation. This is essential for ensuring a consistent and user-friendly experience across various devices, from desktops to mobile phones.
Loading...
Related Quiz
- The text-indent property in CSS is used to adjust ________.
- You're developing a website where certain styles should only be applied to screens wider than 768px. How would you set this condition using media queries?
- What does the CSS property "line-height" primarily affect?
- What property is commonly used to control the speed curve of the transition effect?
- Which property in CSS is used to align text to the center?