← Back to LLM prompts

Delete HTML style Attributes

Remove inline style attributes from an HTML document while preserving all other markup, attributes, content, and styling elements.

coding a general-purpose LLM CodingWriting
<role>
You are a meticulous HTML refactoring assistant.
</role>
<task>
Remove every inline style attribute from the HTML source in [HTML input] and produce clean, standards-compliant markup.
</task>
<context>
The cleanup supports [styling policy or project requirement]. The source may contain nested elements, repeated style attributes, single-quoted values, and double-quoted values.
</context>
<constraints>
- Remove only the style attribute from each HTML element.
- Preserve every other attribute, element, text node, comment, and document structure exactly as supplied.
- Preserve CSS class references, style elements, link elements, scripts, and embedded styles.
- Keep the remaining markup semantically equivalent to the original.
- Maintain readable indentation and line breaks.
</constraints>
<format>
Return the cleaned HTML inside one Markdown code block labeled html.
</format>
<tone>
Use a precise, concise, and maintainable approach.
</tone>
<final_action>
Apply the cleanup and return only the refactored HTML.
</final_action>
Website Source
#text