Can anyone help me tidy up an code error I’m getting in the theme.liquid of the site I’m building?
It’s at the bottom and saying 'Attempting to close HtmlElement ‘body’ before HtmlElement ‘style’ was closed.
Screenshots attached. URL is https://flippin-tables-rubs.myshopify.com/
password skahmo
Hey @SassInnes
This error typically occurs when the HTML structure in your theme.liquid file is not correctly nested, i.e., a tag is closed before a tag that should have been closed earlier. This breaks the HTML structure and can cause issues in rendering the page.
Here’s how the bottom of your theme.liquid file should look:
# Welcome to My Store
Also Search for Unintended Code Injection: If you’re dynamically injecting code via Liquid, ensure no unclosed tags are added.
{% if some_condition %}
{% endif %}
It will cause the error if you have below coding structure.
Fix the Code Ensure the tag or any other tag which is properly closed before closing the tag.