Skip to content
Try free for 7 days
English
EnglishFrenchSoonItalianSoonJapaneseSoonSpanishSoonPortuguese (Portugal)SoonGermanSoonCzechSoonDanishSoonFinnishSoonKoreanSoonNorwegian (Bokmål)SoonDutchSoonPolishSoonPortuguese (Brazil)SoonTurkishSoonChinese (Simplified)SoonChinese (Traditional)Soon
Open in Claude Ask questions about this pageOpen in ChatGPT Ask questions about this page

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.

  1. From Sami Product Labels, go to Badges & Labels. Select Create badge, or select the Edit badge/label icon in the Actions column for an existing badge.

  2. Select Design in the badge editor. This tab is selected by default when the editor opens.

  3. Expand Advanced settings near the bottom of the Design tab.

  4. Under Advanced, turn on Custom css.

  5. The CSS editor appears with three options under CSS reference:

    • .samita_productLabel-content styles the entire badge.
    • .samita_productLabel-content-text styles text badges.
    • .samita_productLabel-content img styles 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 editor and CSS reference selectors

    Select a class under CSS reference to insert a badge-scoped selector into the Custom CSS editor.

  6. Check the live preview while you edit. When the result looks correct, select Save, then verify the badge on the relevant collection or product page in your storefront.

Fix a badge that’s hidden behind a product image overlay, sticky header, or another badge.

  1. In Advanced settings, enable Z-index.
  2. Enter a value from 1 to 100. Higher values place the badge in front of elements with lower z-index values.

Z-index control toggle and value field

Set a z-index value to control badge layering.

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.

  1. In Advanced settings, enable Show tooltip on hover.
  2. Enter the tooltip text that should appear on hover.

Tooltip toggle and text field in Advanced Settings

Add tooltip text that displays when customers hover over the badge.

Do not put essential information only in the tooltip. Touchscreen users and customers navigating with a keyboard may not trigger a hover state.

Set alt text so screen readers can describe the meaning of an image badge. Descriptive alt text can also support image SEO.

  1. In Advanced settings, enable Seo alt text.
  2. 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.”

Alt text field for badge SEO and accessibility

Set alt text for accessibility and SEO.

Was this helpful?