Search⌘ K

Promotional Banner Visibility

Explore how to use CSS media queries to display desktop and mobile promotional banners based on viewport width without altering HTML or using JavaScript. Learn to create responsive visibility rules that ensure optimal banner display on different devices by targeting a 1024px breakpoint.

Problem description

Given an HTML page with two banner sections:

  • <div class="desktop-banner"> contains a promotional image for desktop. ...