Hello!
I’m using the Dawn theme and needing to hide sections on mobile & desktop. I have hidden the first section of my homepage on the mobile successfully. I have hidden the 2nd section on the desktop using the code below, but now it has created a huge gap where the section should be. Anyway to fix this?
Code used to hide the 1st section on mobile in the base.css file:
@media screen and (max-width: 767px){
div#Slide-template–20371453641016__c6791851-27cc-4a0e-b4f8-87bfcd63f2e5-1{
display: none !important;
}
}
Code used on the 2nd section to hide on desktop in the base.css file:
@media screen and (min-width: 767px ){
div#Slide-template–20371453641016__c6eaa615-aaa9-438f-916c-1eb118cfbcef-1 {
display: none !important;
}
}
URL: https://the-mimosa-tree-florist-gift-shoppe.myshopify.com/
Password: yowpur
Thanks for the help!
Hi @highvibecollect ,
Try this one. Its better to use the main section selector.
- From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
- Find the theme that you want to edit and click on “Actions” and then “Edit code”.
- In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
- And Save.
@media only screen and (min-width: 767px){
section#shopify-section-template--20371453641016__c6eaa615-aaa9-438f-916c-1eb118cfbcef,
section#shopify-section-template--20371453641016__81799f2a-7586-4f6d-b7ec-bb9678397363 {
display: none;
}
}
@media only screen and (max-width: 767px){
section#shopify-section-template--20371453641016__c6791851-27cc-4a0e-b4f8-87bfcd63f2e5,
section#shopify-section-template--20371453641016__7de761c3-bb50-418d-aedf-3ea8dc460cd3 {
display:none;
}
}
Result:
I hope it help.
Absolutely brilliant! Thanks a bunch 