only on desktop version
Topic summary
A user seeks to modify image banner height exclusively for desktop view in Shopify’s Dawn theme, while keeping mobile dimensions unchanged.
Primary Solution Approach:
- Add custom CSS using media queries targeting desktop screens (min-width: 1024px or 750px)
- Insert code into
base.cssortheme.cssfile via theme editor - Target
.bannerand.banner__mediaclasses with specific height values (e.g., 500px) - Use
object-fit: coverto maintain proper image scaling
Implementation Issue:
When the user applied the suggested code, an unwanted grey empty space appeared below the banner, indicating the solution needs adjustment.
Alternative Suggestions:
- Apply CSS directly to Custom CSS settings within the Image Banner section settings (rather than global CSS file)
- Target specific banner sections using unique section IDs for more precise control
- Adjust min-height property instead of fixed height
Status: The discussion remains open as the initial solution created layout issues requiring troubleshooting.
Hello @Jim3
To change the image banner height only on desktop in the Dawn theme, you’ll need to use a media query in your custom CSS to target desktop screen sizes.
Here’s a step-by-step (Guide + Code):
**Steps to Add Custom CSS in Dawn Theme:**1. Go to Online Store > Themes > Customize
-
In the theme editor, click the three-dot menu (⋮) in the top-left and choose “Edit code”
-
Open the file:
Assets > base.css (or theme.css in older versions) -
Scroll to the bottom and paste the following code:
CSS to Adjust Banner Height Only on Desktop
/* Desktop-specific banner height */
@media screen and (min-width: 1024px) {
.banner, .banner__media {
height: 500px !important; /* Change this to your desired height */
max-height: 500px !important;
object-fit: cover;
}
}
You can adjust the 500px to any height that works best for your design.### Optional: Target a Specific Banner Section
If you only want to apply this to a specific banner, inspect it in your browser and look for a unique section ID like:
<section id="shopify-section-template--123456789__banner">
Then update the CSS like this:
@media screen and (min-width: 1024px) {
#shopify-section-template--123456789__banner .banner__media {
height: 600px !important;
}
}
Let me know if you want to:
-
Target mobile height separately
-
Apply different styles to multiple banners
-
Or want help locating the exact section ID
Thank you for your reply! Unfortunately when I applied the code, this was the outcome on the sreenshot below:
It left this grey empty space
Hi @Jim3 ![]()
To change the image banner height only on the desktop version for the Dawn theme, you can easily do this using CSS media queries. Here’s a quick solution you can try:
-
Go to Online Store → Themes → Customize
-
Click on Theme settings → Custom CSS (or alternatively, add in your theme’s CSS/SCSS file)
Add the following code:
@media screen and (min-width: 1024px) {> .banner__media {> height: 500px !important; /* Adjust the height as per your requirement /> object-fit: cover; / Optional: ensures image covers the area nicely */> }> }- This will apply the new banner height only on desktop devices (screen width 1024px and above).
- You can adjust the height value (500px) to whatever suits your design.
Hope this helps!
Let me know if you need help with mobile-specific adjustments too.
Regards,
Hi @Jim3 ,
Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:
@media screen and (min-width: 750px) {
.banner {
min-height: 450px !important;
}
}

