Custom badge not displaying properly on mobile

Custom badge not displaying properly on mobile

JasonP5
Tourist
7 0 3

I am currently trying to get my badge to properly display on mobile but am running into one issue. I am displaying a badge for items that have a specific vendor tag. The mobile badge is not overlaid onto the product photo and is also pushing the image down. 

Badge:
{% if product.vendor == '1X-2X-3X' %}
<span class="badge-plus">Plus</span>
{% endif %}

CSS:
.badge-plus {
position: absolute;
top: 13px; /* Adjust if needed to position the badge within the container */
right: 0; /* Adjust if needed to position the badge within the container */
background-color: #464544; /* Bright orange for high visibility */
color: white;
padding: 2px 7px; /* Increase padding if the text is not fully visible */
font-size: 11px; /* Increase font size if needed */
font-weight: normal;
text-transform: uppercase;
border-radius: 5px;
z-index: 2; /* Ensures it is on top of other elements */
display: inline-block; /* Ensures the element respects padding and size */
width: 45px; /* Minimum width to ensure text visibility */
opacity: 40%;

Desktop view:
Screenshot 2024-05-10 at 3.11.00 PM.png

Mobile view:
Screenshot 2024-05-10 at 3.13.22 PM.png

Replies 2 (2)

INA_MSWEB
Shopify Partner
1281 144 164

Hello,

 

I am San from MS Web Designer.

 

Please share the store URL so that we can assist you.

 

Regards,

San

If it’s helpful to you, please mark it as a solution.  


Need Help with Shopify Design, Migration, Speed, or Custom tasks?  
email: hi@mswebdesigner.com
Try Our Conversion Booster app to get more sales | Connect Our Founder Linkedin

JasonP5
Tourist
7 0 3