Use custom CSS
Use custom CSS, z-index control, tooltip text, and SEO alt text for advanced badge customization.
For styling that goes beyond the visual editor, Sami Product Labels includes a built-in CSS editor. You can also control badge layering with z-index, add hover tooltips, and set alt text for image badges.
How to add custom CSS
Insert a selector and add your CSS
The CSS editor appears with three options under CSS reference:
.samita_productLabel-contentstyles the entire badge..samita_productLabel-content-textstyles text badges..samita_productLabel-content imgstyles image badges.
Select the option you need. The app inserts a selector scoped with the current badge ID, such as .__content--94129, into the editor. Keep that badge-specific part of the selector, then add only the declarations you need inside the braces.
/* Use the badge ID inserted by the app in place of YOUR_BADGE_ID. */
.samita_productLabel-content.__content--YOUR_BADGE_ID {
box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}
.samita_productLabel-content.__content--YOUR_BADGE_ID:hover {
transform: scale(1.1);
transition: transform 0.2s ease;
}
Custom CSS is saved with this badge, but its selectors still determine which storefront elements it can affect. Keep the badge-scoped selector generated by the app. A broad selector such as .samita_productLabel-content on its own can also match other badges.
Z-index control
Fix a badge that's hidden behind a product image overlay, sticky header, or another badge.
In Advanced settings, enable Z-index.
Enter a value from 1 to 100. Higher values place the badge in front of elements with lower z-index values.

Tooltip on hover
Add a tooltip that appears when customers hover over your badge — useful for explaining what "New Arrival" or "Limited Edition" means without cluttering the product image.
In Advanced settings, enable Show tooltip on hover.
Enter the tooltip text that should appear on hover.

Do not put essential information only in the tooltip. Touchscreen users and customers navigating with a keyboard may not trigger a hover state.
SEO alt text for image badges
Set alt text so screen readers can describe the meaning of an image badge. Descriptive alt text can also support image SEO.
In Advanced settings, enable Seo alt text.
Enter a concise description of the message conveyed by the badge, such as "20% off sale badge" or "Free shipping label". Avoid keyword stuffing and phrases such as "image of."

Next steps
Change badge style — Customize your badge using the visual editor controls.
Change badge position — Place your badge at the right location on the page.
Need support?
If you run into any difficulty while following these steps, contact us at support@samita.io.
Last updated
Was this helpful?