HTML to Shopify Section: A Real Before and After Conversion Example
See exactly what the HTML to Liquid converter produces: input HTML and CSS, the generated Liquid section, scoped CSS and schema, with notes on how to edit each part.
Share with Shopify developers — useful guides spread faster in theme dev communities.
The input
A simple promo banner written as plain HTML with a small <style> block:
<style>
.promo { background: #f1f5f9; padding: 48px 20px; text-align: center; }
.promo__title { font-size: 32px; margin: 0 0 8px; }
.promo__btn { display: inline-block; background: #111827; color: #fff; padding: 12px 24px; border-radius: 8px; text-decoration: none; }
</style>
<section class="promo">
<h2 class="promo__title">Free shipping on orders over $50</h2>
<p class="promo__text">Fast delivery and easy 30 day returns.</p>
<a href="/collections/all" class="promo__btn">Shop now</a>
</section>
The generated Liquid (flat mode)
<section class="promo {{ section.settings.custom_class }}" style="padding-top: {{ section.settings.padding_top }}px; padding-bottom: {{ section.settings.padding_bottom }}px;">
{% if section.settings.heading_1 != blank %}
<h2 class="promo__title">{{ section.settings.heading_1 | escape }}</h2>
{% endif %}
{% if section.settings.description_1 != blank %}
<p class="promo__text">{{ section.settings.description_1 | escape }}</p>
{% endif %}
{% if section.settings.button_label_1 != blank and section.settings.button_link_1 != blank %}
<a class="promo__btn" href="{{ section.settings.button_link_1 }}">{{ section.settings.button_label_1 | escape }}</a>
{% endif %}
</section>
The converter replaced hardcoded text with section.settings values, guarded each element so empty fields disappear, and kept your class names.
The generated schema (shortened)
{% schema %}
{
"name": "Promo",
"settings": [
{ "type": "text", "id": "heading_1", "label": "Heading", "default": "Free shipping on orders over $50" },
{ "type": "textarea", "id": "description_1", "label": "Description", "default": "Fast delivery and easy 30 day returns." },
{ "type": "text", "id": "button_label_1", "label": "Button Label", "default": "Shop now" },
{ "type": "url", "id": "button_link_1", "label": "Button Link", "default": "/collections/all" }
],
"presets": [{ "name": "Generated Section" }]
}
{% endschema %}
The original text became each setting's default, so the section looks the same as soon as you add it. The real output also adds style settings such as padding and a custom class.
The scoped CSS
Your CSS is kept and prefixed with #shopify-section-{{ section.id }}, so it only affects this section:
#shopify-section-{{ section.id }} .promo { background:#f1f5f9; padding:48px 20px; text-align:center }
#shopify-section-{{ section.id }} .promo .promo__title { font-size:32px; margin:0 0 8px }
#shopify-section-{{ section.id }} .promo .promo__btn { display:inline-block; background:#111827; color:#fff; ... }
What to check after converting
- Paste the full output into
sections/promo.liquidand add it in the theme editor. - Change each setting and confirm the preview updates.
- Clear a field to confirm the element hides.
- Check the section on mobile.
- Rename the preset from "Generated Section" to something merchants understand.
Takeaway
The converter does the repetitive work: settings, schema and scoped CSS. You review and refine. Try it on your own HTML in the converter, read the Shopify Liquid converter guide and the HTML to Shopify Liquid guide.
Try it with our free tools
Paste your HTML into the HTML to Liquid converter to generate a section with schema, or pick a layout from Ready Sections. Questions? Use the contact form.
Review checklist after any conversion
Whether you convert by hand or with the converter, review the result before it reaches a live store.
- Setting ids are meaningful. Rename
heading_1to something a merchant understands if the section will be reused. - Every Liquid tag has a schema entry, and every schema entry is used.
- Empty values are handled. Clear each field in the editor and confirm no broken images or empty buttons appear.
- Heading levels make sense. Only one h1 per page.
- Images have alt text and use responsive Shopify image filters.
- CSS is scoped to the section id.
- A preset exists so the section can be added from the editor.
If all seven pass, the section is safe to test on a duplicate theme.
Topic cluster
HTML Conversion
Converting HTML to Liquid sections and converter workflows.
Convert your HTML to Shopify Liquid
Paste a module, generate Liquid + schema, then copy the result into your theme. Free to try—no signup required for a sample conversion.
Share
Share this guide
Found this guide useful? Share it with other Shopify developers on LinkedIn, X, or Reddit.