CSS not getting added to head when using HTML visual Fragments | Community
Skip to main content
Level 1
April 2, 2026
Question

CSS not getting added to head when using HTML visual Fragments

  • April 2, 2026
  • 2 replies
  • 8 views

Hello,

We are getting this issue:

 

The CSS that we add to the Template via the + Custom CSS button (and also in fact ALL CSS and meta tags) are not getting injected into the head tag area.

 

This is only happening when we add in a hand-coded HTML Visual Fragment. 

 

The CSS IS getting added into the head when just the native drag and drop Adobe modules are used. 

 

Please can anyone identify why this is the case and how to solve please?

2 replies

Level 1
April 2, 2026

Here is a more detailed description of our issue:
 

  1. We create an email template.
  2. We create fragment templates to be used within that template.
  3. At the template level, we add CSS using the Custom CSS area ("+ Add custom CSS").
  4. At this stage, the CSS is correctly added to the <head> section of the template.
  5. We then create an email delivery based on this template.
  6. When we add fragments into the template content areas, the CSS — along with several <meta> tags — is automatically moved from the <head> section into the <body> of the email.



Issue observed:
Moving the CSS and meta tags into the <body> causes rendering issues, particularly in the Gmail app on Android, which does not properly read styles located in the <body>. As a result, the email layout appears broken in that environment.
Expected behaviour:
CSS added via the template-level Custom CSS area should remain in the <head> section of the email, regardless of whether fragments are inserted into the template.

Additional context:
The behaviour occurs specifically after adding fragments to the email.

  • Without fragments, the CSS remains correctly placed in the <head>.
  • Built-in fragments appear to behave differently and do not trigger this issue.

Could you please confirm:

  1. Whether this is a known limitation or issue when using fragments
  2. If there is a recommended configuration or workaround to ensure CSS remains in the <head>
  3. Whether this behaviour differs between fragment types or template configurations
AmitVishwakarma
Community Advisor
Community Advisor
April 2, 2026

Hi ​@annevander 

The issue was caused by mixing Theme‑mode templates with a Manual/HTML Visual Fragment. When a manual HTML fragment is used inside a Theme‑based email, the Theme's head injection (including + Custom CSS and meta tags) stops working. What fixed it:

1.Recreated the fragment as a visual fragment (Theme mode only)

  • No <html>, <head>, <body>, <style>, or <meta> tags inside the fragment.
  • Only body‑level markup/components.

2.Removed the old HTML Visual Fragment from the email

  • Dropped in the new Theme‑mode visual fragment instead.

3.Kept all CSS/meta only at the template level

  • Used the template's + Custom CSS for styles.
  • Did not put <style> or <meta> inside any fragment.

After doing this, the template‑level CSS and meta tags were again injected correctly into the <head> for all sends.

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME