A media query makes CSS responsive by applying styles when a viewport condition is true. In a MyBlog banner, the default rule hides the image, while a minimum width of 768 pixels restores it for larger screens. This preserves small-screen space for content without requiring separate page layouts. section 7.2.1
The technique relies on CSS’s cascade: the later rule overrides the earlier one when its condition matches. Keeping the base rule and conditional override in base.css makes the behavior reusable across templates that inherit from base.html, including Bootstrap-styled pages. section 7.2.1
Hide a banner on narrow screens
Define `.banner { display: none; }`, then add `@media (min-width: 768px) { .banner { display: block; background: var(--background-url) no-repeat center center / cover; } }`. Resizing the browser activates the query and reveals or removes the banner.






