Show details for Classes, IDs and HTML Attributes in Content Templates

Classes, IDs and HTML Attributes in Content Templates

Use the Advanced fields of any content template item - Classes, ID and HTML Attributes - to style it from CSS Override, link straight to it, and add accessibility or data attributes.

Classes, IDs and HTML Attributes in Content Templates

Use the Advanced fields of any content templateFunctionality provided by Infigo allowing you to create and format site content without directly interacting with HTML. item - Classes, ID and HTML Attributes - to style it from CSS Override, link straight to it, and add accessibility or data attributes.

Guide8 min readVideo14-step guideUpdated 15 Oct 2026

Overview

Open the Configure settings (the cog) of most content template items and you'll find an Advanced area with three fields: Classes, Add id html attribute? with its ID box, and HTML Attributes. None of them changes the page by itself. Each adds something to the item's HTML, which you then put to work - usually with a few lines of CSS in CSS OverrideAn area of Infigo where parts of the CSS code can be overriden with your own custom code.

What it does

  • Classes - add your own class names to an item, then style them in CSS Override. Reuse the same class on as many items as you like.
  • ID - give one item a unique name. Link straight to it from a button or link, or target it in CSS.
  • HTML Attributes - add name and value pairs to the item's HTML, such as an accessibility label (aria-label), a data value for CSS or an analytics tool (data-...), or schema information (itemscope).

How it works

  • Classes are added to the item's class list - on a section, the section tag itself.
  • ID is added as id="..." only while Add id html attribute? is set to Yes.
  • HTML Attributes are entered one row per attribute (Attribute and Value) and written as name="value".
  • Jump links use the page's full address followed by # and the ID, for example .../t/YourPage#delivery.
  • CSS targets a class with a full stop (.sizes-card), an ID with # (#delivery) and an attribute with square brackets ([data-badge]).

Good to know

  • Sections, blocks, titles, paragraphs, images, buttons, lists, accordions and embeds have all three fields. Columns have Classes only. Header menu items have none.
  • On a button, use the cog of the individual Button row, not the Buttons item.
  • Type names and values only - no full stop before a class, no # before an ID, and no quote marks or = in attributes.
  • Use each ID only once on a page.
  • A Target URL of just #your-id opens the storefront home page - always use the page's full address.
  • Uploading a CSS file in CSS Override replaces the previous one. Download the current file first and add to it.
  • Save the page and clear the cache to see your changes on the storefront.
TipTo check what an item outputs, right-click it on your storefront and choose Inspect - you'll see your class, ID and attributes in its HTML.

Before you begin

  • You need to be comfortable writing a few lines of CSS.
  • Your page must use the Content Template Editor.

Step-by-step

  1. Look at the page before you change anything

    This example is a content pageAdditional pages on your Storefront containing supplementary information. built with the Content Template Editor: four sections (Event signage, Pick your sizes, Send us your artwork, Delivery options) and a See delivery options button. Before: every section looks the same, the button is a plain square, and it has no useful target - clicking it opens the storefront home page. The second picture is the page's HTML for the Sizes section, the Delivery section, the Delivery heading and the button: there is no ID, no extra class and no extra attribute yet. Keep these in mind - the last steps show the same page and the same HTML after the changes.

    Before: plain sections, square button

    Before: plain sections, square button

    Before: the rendered HTML - no id, class or attribute added

    Before: the rendered HTML - no id, class or attribute added
  2. Open the item's Configure settings

    Go to Content Management > Content Pages, open your page and expand the item you want to change. Click its cog icon to open Configure, then scroll to Advanced near the bottom. Sections, blocks, titles, sub titles, paragraphs, images, buttons, lists, accordions and embeds have all three fields; columns have Classes only, and header menu items have none. Close the window with Ok when you are done - your changes are kept until you save the page.

    Configure - the cog icon on any item

    Configure - the cog icon on any item
  3. Add a class in Classes

    WHAT: type one or more class names into Classes, separated by spaces - here sizes-card on the Pick your sizes section. WHY: a class is a label your CSS can target, so you can style one item differently from the rest without touching the theme. WHAT IT DOES: the class is added to the item's HTML (on a section, the <section> tag). Type the name without a full stop, and use lower case letters, numbers and hyphens. WHEN: use a class when you want a style you can reuse - the same class can go on as many items as you like. EXPECT: no change on the storefront until your CSS file has a rule for the class (step 11).

    Advanced > Classes: sizes-card

    Advanced > Classes: sizes-card
  4. Give a section an ID

    WHAT: set Add id html attribute? to Yes - the ID box appears - and type a name, here delivery on the Delivery options section. WHY: an ID is a unique name for one item on the page. You can link straight to it, and CSS can target it. WHAT IT DOES: adds id="delivery" to the item's HTML. The ID is only added while the setting is Yes. WHEN: use an ID for a single item you want to link to, such as a delivery, FAQ or contact section. EXPECT: each ID must be used only once on a page; type it without a # and without spaces.

    Add id html attribute?: Yes / ID: delivery

    Add id html attribute?: Yes / ID: delivery
  5. Link a button to the ID

    WHAT: on the button, set Target URL to the page's full address followed by # and the ID - for example https://your-store-address/t/YourPage#delivery. You can copy the page's address from the URLs link at the top of the content page. WHY: this makes a jump link: the button scrolls the page down to that section. EXPECT: use the full address. We tested the shorter forms: #delivery on its own sends visitors to the storefront home page, and an address starting with /t/ can miss part of your store's address. The same works from anywhere else on your storefront - a link to .../t/YourPage#delivery opens the page at that section.

    Target URL: the page's full address + #delivery

    Target URL: the page's full address + #delivery
  6. Add a class to the button

    Buttons have their own Configure settings - click the cog on the individual Button row, not on the Buttons item. In Advanced > Classes type pill-button. The class is added to the button itself, next to the theme's own button classes, so your CSS can change its shape without affecting any other button.

    Classes: pill-button

    Classes: pill-button
  7. Add an HTML attribute

    WHAT: under HTML Attributes click Add new Attribute (on sections and headings the button reads Add new HTML attribute), expand the new row, and fill in Attribute (the name) and Value. Here the button gets aria-label = Jump to the delivery options. WHY: attributes carry extra information about an item: aria-label tells screen readers what a button does, data-... attributes give analytics and tag tools something to recognise, and schema attributes such as itemscope describe content to search engines. WHAT IT DOES: the platform writes aria-label="Jump to the delivery options" into the button's HTML. EXPECT: type the name and the value only - no = and no quote marks, they are added for you. Avoid double quotes inside a value. Add one row per attribute.

    Attribute: aria-label / Value: Jump to the delivery options

    Attribute: aria-label / Value: Jump to the delivery options
  8. Add a data attribute to a heading

    Open Configure on the Delivery options Title and add an attribute data-badge with the value Updated. A data- attribute is your own named value: it is invisible by default, but CSS can display it (step 11) and analytics tools can read it. Change the value later and the badge text changes with it - no CSS edit needed.

    Attribute: data-badge / Value: Updated

    Attribute: data-badge / Value: Updated
  9. Save the page and clear the cache

    Click Save and Continue Edit, then Clear cache in the admin top bar so the storefront shows the new HTML straight away.

    Save and Continue Edit, then Clear cache

    Save and Continue Edit, then Clear cache
  10. Upload the CSS that uses them

    Go to Content Management > CSS Override. Uploading a file replaces the whole CSS Override file, so first use Download the uploaded CSS file, add your new rules to the end of that file, and upload the combined file with Upload a new CSS file. Clear the cache again afterwards.

    Content Management > CSS Override > Upload a new CSS file

    Content Management > CSS Override > Upload a new CSS file
  11. Style the class, ID and attribute in CSS

    In CSS each field is targeted in its own way. A class starts with a full stop: .sizes-card { ... } turns the Sizes section into a framed card, and a.button.pill-button rounds the button's ends (add !important where the theme already styles that property). An ID starts with #: #delivery { scroll-margin-top: 100px; } stops the fixed storefront header covering the section after a jump. An attribute goes in square brackets: [data-badge]::after { content: attr(data-badge); ... } shows the attribute's value as a label after any item that has it.

    .sizes-card - a class starts with a full stop

    .sizes-card - a class starts with a full stop

    #delivery - an ID starts with # / [data-badge] - an attribute

    #delivery - an ID starts with # / [data-badge] - an attribute
  12. Check the result on your storefront

    After: open the page on your storefront. The Sizes section is now a framed card (the sizes-card class) and the button has rounded ends (the pill-button class). Compare it with the first picture in step 1.

    After: framed Sizes card, rounded button

    After: framed Sizes card, rounded button

    class sizes-card -> framed card

    class sizes-card -> framed card
  13. Test the jump link

    Click See delivery options. The address now ends in #delivery and the page scrolls down to the Delivery options section, which shows the UPDATED badge from its data-badge attribute. When the section is near the bottom of the page, the page scrolls as far as it can, so the section may not reach the very top of the screen.

    After clicking: scrolled to #delivery, badge from data-badge

    After clicking: scrolled to #delivery, badge from data-badge
  14. See what each field adds to the HTML

    This is the same HTML as in step 1, after the changes: sizes-card has been added to the Sizes section's classes, the Delivery section has id="delivery", the heading has data-badge="Updated", and the button has the pill-button class, its new link and aria-label. To check your own page, right-click the item in your browser and choose Inspect. If something does not appear, check the spelling in Configure, that the page was saved, and that the cache was cleared.

    After: class, id, data-badge and aria-label in the HTML

    After: class, id, data-badge and aria-label in the HTML

Video transcript

Overview video

0:00 Classes, IDs and HTML attributes in content templates

0:05 Most content template items have an Advanced area in their settings, with three fields: Classes, an ID, and HTML Attributes. They don't change the page on their own. Each one adds something to the item's HTML that you can then use.

0:21 Here's a content page built with the Content Template Editor. Every section looks the same, and the button doesn't go anywhere useful yet.

0:30 A class gives an item a label your CSS can target. With one class and a short rule in CSS Override, this section becomes a framed card, and the button gets rounded ends.

0:42 An ID gives one item a unique name. Point a button at the page's address followed by the ID, and clicking it scrolls straight to that section.

0:52 HTML attributes add extra information. Here, the button has an accessibility label for screen readers, and the heading has a data value that CSS shows as a badge.

1:04 It's all set in each item's Configure settings, with a few lines of CSS in CSS Override. The step-by-step guide on this page shows each one.

Step-by-step video

0:00 Use classes, IDs and HTML attributes in content templates

0:05 In this tutorial we'll use the three Advanced fields of a content template item: Classes, the ID, and HTML Attributes. We'll look at a page before, make the changes, and check the result. You'll need to be comfortable with a few lines of CSS.

0:21 This is our example page. The sections all look the same, and the See delivery options button just opens the home page.

0:29 This is the page's HTML for the sections, the delivery heading, and the button. There's no ID, no extra class, and no extra attribute yet.

0:39 In the admin area, go to Content Management, then Content Pages, and edit your page. Click the cog on the item you want to change. Advanced is near the bottom of the Configure window.

0:52 In Classes, type a class name. We'll use sizes-card on the sizes section. Leave out the full stop, and separate several classes with spaces.

1:01 For the delivery section, set Add id html attribute to Yes, and type the ID: delivery. An ID must be used only once on a page, with no spaces and no hash.

1:13 Now open the button. Set its Target URL to the page's full address, followed by a hash and the ID. Use the full address. On its own, hash delivery opens the home page.

1:25 Each button has its own cog. In its Classes, type pill-button.

1:30 Under HTML Attributes, click Add new Attribute, then fill in the name and the value. Here it's aria-label, which tells screen readers what the button does. Don't type quote marks or an equals sign. They're added for you.

1:44 On the delivery heading, add an attribute called data-badge, with the value Updated. Data attributes are your own named values. CSS and analytics tools can read them.

1:55 Click Save and Continue Edit, then Clear cache in the top bar.

2:01 Go to Content Management, then CSS Override. Uploading replaces the whole file, so download the current one, add your rules to the end, and upload it.

2:11 In CSS, a class starts with a full stop. This rule turns any item with the sizes-card class into a framed card.

2:20 An ID starts with a hash. This rule stops the fixed header covering the section after a jump. An attribute goes in square brackets. This one shows the data-badge value as a label.

2:32 Back on the storefront, the sizes section is now a framed card, and the button has rounded ends.

2:39 Click the button, and the page scrolls to the delivery section, with the Updated badge from its data attribute.

2:46 And here's the HTML now: the new class, the ID, the data attribute, and the accessibility label, exactly as we typed them.

2:56 That's it. Classes let you style an item, an ID lets you link straight to it, and attributes add extra information. If something doesn't show, check the spelling, save the page, and clear the cache.

Search terms

Guide | Classes, IDs and HTML Attributes in Content TemplatesLast updated: 15 Oct 2026
Incomplete