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?
- @media (min-width: 768px) { /* Styles go here */ }
- @media (screen, min-width: 768px) { /* Styles go here */ }
- @media screen (min-width: 768px) { /* Styles go here */ }
- @media screen and (min-width: 768px) { /* Styles go here */ }
To create a media query for screens wider than 768px, you should use the @media rule, followed by the screen keyword (optional) and and (min-width: 768px). The correct option is @media screen and (min-width: 768px) { /* Styles go here */ }.
Loading...
Related Quiz
- When using float, what happens to the element's position in the normal document flow?
- In a media query, which feature is commonly used to detect the width of the viewport?
- How can you target an element that is the only child of its parent using a pseudo-class?
- What does the 'padding' property in CSS affect?
- You want to target all paragraphs that are immediately after an h2 element within the same container. Which CSS selector combination will you use?