We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Move Badges Higher

Move Badges Higher

takeoverapparel
Excursionist
51 0 13

Hi, this is the current code I have to move my related collection, which is on every product page, as shown below. This is just for mobile. I want to move the out-of-stock and sales badges higher, but when I try to increase the height, it cuts off. My website is takeoverapparel.com, and the password is takeover. 

 

Code in base.css

/* Product Page You May Like... Badges */
 
 /* Green Monster TakeOver Badges */
 #Slider-template--18239906578584__featured_collection_LTLQ7U .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
 /* Red Monster TakeOver Badges */
  #Slider-template--18239944261784__featured_collection_46GmUa .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
  /* Be A Monster Sweatshirt Badges */
  #Slider-template--18553494667416__featured_collection_WJRyzf .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
    /* Sleeveless Panther Tee */
   #Slider-template--18553508659352__featured_collection_nyKmza .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
 /* Black Nylon Shorts */
  #Slider-template--18553500270744__featured_collection_U3qXnX .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
   /* Light Blue Nylon Shorts */
#Slider-template--18553494700184__featured_collection_XJF3hL .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
  /* Red Nylon Shorts */
 #Slider-template--18553494765720__featured_collection_FR8wAx .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
  /* Pink Nylon Shorts */
  #Slider-template--18553494831256__featured_collection_gpxEEd .card__badge.top.left{
  position: absolute;
  top: -15px !important;
  margin-left: -10px!important;
  margin-top: -5px!important;
}
}
 
Screenshot 2025-06-27 at 7.33.02 PM.png
Replies 3 (3)

PaulNewton
Shopify Partner
8031 687 1646

@takeoverapparel On desktop when I try similar code the badges are not obscured by any other elements.

On mobile add some top margin to the containing card or to the section, e.g.:

#Slide-template--18239906578584__featured_collection_LTLQ7U-2 { margin-top: 25px; } 

 

Unless your giving each section it's own custom properties you should try deduplicating the code and moving this into a theme level custom css.

Use an attribute selector with the section id's prefix  #Slider-template- etc etc to not have to hardcode specific ids that can break when you make future changes to section content.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


takeoverapparel
Excursionist
51 0 13

that didnt work also this is only for mobile that why it doesn't show on desktop 

The_ScriptFlow
Explorer
201 17 25

Hey @takeoverapparel,

I can see the selection of the classes are not the correct. You are selecting the css with the section ID that cannot be effect anymore when you make the theme Draft or somehow to make it live again. Because the section ID's change everytime.

Could you grant me access of the store so that I can make the correct selection of the classes.

Thanks

- Need a Shopify Specialist? Chat on WhatsApp Or Email at info@thescriptflow.com
- For any custom section queries, bug fixing please visit: Level 2 Fiverr Profile
- Buy Me a Coffee? Nah… Let’s Upgrade to a Car
- If my solution was helpful, mark it as a solution and hit the like button!