Dawn Theme: Moving Sustainability Badge On Website Using Code - Need Guidance

Topic summary

A user is attempting to reposition a sustainability badge on their Shopify Dawn theme website. The badge displays correctly on desktop (bottom right corner) but needs adjustment for mobile devices to match this placement.

Technical Details:

  • Badge code exists in both theme.liquid and base.css files
  • User shared site credentials for troubleshooting
  • Multiple solutions proposed involving CSS media queries and custom classes

Proposed Solutions:

From PageFly-Lucas: Add CSS to base.css targeting the badge link with negative margin adjustments for mobile screens (max-width: 589-600px)

From suyash1:

  • Add custom class custom_badge to the HTML badge code
  • Replace existing HTML in theme.liquid (after </body> tag)
  • Add specific CSS to end of base.css with media query for screens under 749px
  • Use transform: translate(15%, -60%) positioning

Current Status:
User successfully achieved correct placement but encountered visibility issues. The badge appears broken or removed at the specified location. Discussion suggests checking image URL integrity and proper code placement before </html> tag. The issue remains unresolved with troubleshooting ongoing.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

Hello, everyone! I’m reaching out for assistance with a website issue. I’m trying to move my sustainability badge on mobile to the bottom right corner, just like it appears on the desktop version. However, I’ve encountered difficulties when attempting to make this adjustment specifically only for the mobile version using different codes. I’ve attached some images to below a visual reference. Any help would be greatly appreciated!

Here’s my current code for the badge:
custom packaging

desktop.png

Screenshot 2023-05-21 at 15.26.48.png

@oliverconscire - can you please share this page link?

1 Like

Hi @oliverconscire

This is Lucas from PageFly - Landing Page Builder App

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file base.css

Step 3: Paste the below code at bottom of the file → Save

@media only screen and (max-width: 589px)

a[href=“https://packhelp.co.uk/sustainability//?utm_source=ecobadge&utm_medium=online&utm_campaign=eco”] img {

margin-top: 700px;

}

}

Hope that my solution works for you.

Best regards,

Lucas| PageFly

1 Like

@suyash1 Absolutely.
https://conscire.co.uk/
Password: Conscire9898!

@PageFly-Lucas Thanks. Just followed your instructions but it doesn’t work for me unfortunately.

1 Like

Hi @oliverconscire

Please try again with this code:

@media only screen and (max-width: 589px){
a[href=“https://packhelp.co.uk/sustainability//?utm_source=ecobadge&utm_medium=online&utm_campaign=eco”] img {
margin-bottom: -100px !important;
}
}

1 Like

@oliverconscire - please add custom class to your code above so it becomes

[
![custom packaging](https://packhelp-landing-static.s3.eu-central-1.amazonaws.com/sustainability/eco-badge-color-white.p...)

](Sustainability Hub | Packhelp)

and then add this given css to the very end of your base.css file

@media screen and (max-width:749px){
.custom_badge{top: 0 !important; left: -5% !important; transform: translate(15%, -60%) !important;}
}

should look like this

1 Like

@suyash1 Thank you that’s exactly the placement I’m looking for.

I’m not quite sure how to get it right though.

This is my bottom base.css @media only screen and (max-width: 600px){
a[href=“https://packhelp.co.uk/sustainability//?utm_source=ecobadge&utm_medium=online&utm_campaign=eco”] img {
margin-bottom: -100px !important;
}
}

Where exactly should I paste the code you mentioned? Thank you for your time here.

@PageFly-Lucas Thank you sir. Now I just need to place it in the bottom right corner.

@oliverconscire - please replace your html with my html code, I added class to it and irrespective of the existing code in base.css , add my given css after it

@suyash1 Like this? I apologise for my rookie coding skills.

@oliverconscire - no, please add only css code to end of base.css file… add my given html code in the place of your html code below, replace below code with my

custom packaging

@suyash1 I’m slightly confused since I have the code in both theme.liquid and base.css.

Here’s the code in my bottom theme.liquid

custom packaging

And here’s the code in base.css

@media only screen and (max-width: 600px) {
a[href=“https://packhelp.co.uk/sustainability//?utm_source=ecobadge&utm_medium=online&utm_campaign=eco”] img {
margin-bottom: -100px !important;
}
}
.header__icon {
color: #dcc9b6 !important;
}
.list-social__link {
color: #dcc9b6 !important;
}

Could you please show me exactly where I should paste this code? Thank you for your patience.

@oliverconscire - add the HTML code below in place of html code which you have in theme.liquid file after

[
![custom packaging](https://packhelp-landing-static.s3.eu-central-1.amazonaws.com/sustainability/eco-badge-color-white.p...)

](Sustainability Hub | Packhelp)

and then add this given css to the very end of your base.css file

@media screen and (max-width:749px){
.custom_badge{top: 0 !important; left: -5% !important; transform: translate(15%, -60%) !important;}
}

@suyash1 Thank you. Placement is correct, however, the badge is not visible now. Should I keep my current code in theme liquid or replace it with your code? I’ve tried both variations placed after but it doesn’t seem to work. My theme liquid is now back to the original one but I have added the base.css code you just provided.

You will need to replace old code with my, and then add given CSS to the
end of base.css file

@suyash1 Like this?

@oliverconscire - only recommendation is that please move that tag and place it just before and everything should be ok

1 Like

@suyash1 Thank you for your reply.
It looks like this.

This is shown on desktop.

@oliverconscire - check image URL, may be image is removed or broken at that place

1 Like

Could you share how you’re currently adding the badge code to your theme? Sometimes the placement depends on whether it’s inside a section, block, or theme file. I might be able to suggest a more precise fix if I know where it’s coded