DeepSeek and HTML
Published on Mar 7, 2025, filed under development (feed). (Share this on Mastodon or Bluesky?)
Asking about the most minimal valid HTML document is one of my favorite questions to ask any LLM/AI. Using Ollama, I ran DeepSeek * to encounter the following gem of an answer.
âWhat Is the Most Minimal Valid HTML Document?â
Okay, I need to figure out what the most minimal valid HTML document looks like. The user provided an example with a version number, doctype declaration, basic structure of html, head, and body tags. [No, the user had only provided the question.]
First, I should consider why itâs considered minimal. It probably doesnât include any CSS or JavaScript because those can complicate things. So, maybe just the barebones structure without any external styles.
The version attribute is important for compliance. The latest valid HTML5 is a good default since itâs widely supported and has fewer features that might cause issues.
The doctype declaration is essential to specify XHTML10 or XML10 [sic] as per the standards. Using XHTML makes sense because not all websites support pure HTML without any CSS.
The html element starts with
lang="en"
for language specification, which isnât strictly necessary but good practice. The head contains meta tags likecharset
andviewport
for basic responsiveness. Including a title is standard.In the body tag, the
innerHTML
or content should be simple. Using<h1>Hello World</h1>
is straightforward and clear. Including a line break with&amp;ltbr&gt;
[sic] makes it visually distinct so people can see that thereâs more content inside without relying on whitespace.I should ensure all tags are properly closed:
html
,head
,body
,h1
, and the self-closing meta tag for charset.Double-checking the structure to make sure there are no extra attributes or unnecessary elements. Each part is necessaryâlike the version, doctype, html5, lang, meta tags, title, body content.
Is there anything else? Maybe a comment indicating itâs XHTML10. That makes it clear which standard weâre using.
Putting it all together, I can write out the HTML document step by step, making sure each part is present and necessary. Then, explain why each component is included to highlight minimality.
The most minimal valid HTML5 document includes essential tags with a modern meta tag and basic structure. Hereâs an example:
<!DOCTYPE html5 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/ÂDTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Minimal HTML5</title> </head> <body> <h1>Hello World</h1> &ltbr&gt This is a minimal XHTML document with the latest standards. </body> </html>
Explanation of Key Components
- Version: âhtml5â specifies modern HTML5 features. Using XHTML 1.0 Transitional ensures compliance and better support across browsers.
- Doctype declaration:
<!DOCTYPE html5 âŚ>
declares XHTML, while pure HTML requires additional CSS meta tags for functionality.- Basic structure:
html
,head
,title
,body
are core elements needed to define any web page.- Meta tags: Include charset and viewport meta tags.
lang="en"
is optional but good practice.- InnerHTML: Simple text content with a line break using the correct HTML entity for
&amp;ltbr&amp;gt
[sic].- Comment: Indicate XHTMLÂ 1.0 compliance.
This document is minimal while being valid, covering all necessary elements and standards.
This is as astonishingly detailed â as it is astonishingly bad.
It may read like a great explanation of what must then sound like the most minimal HTML document, but itâs neither the most minimal HTML document (thatâs <!DOCTYPE html><title>âŁ</title>
), nor a good explanation for any HTML document (itâs not all wrong, but it would be easier to start fresh than to correct all the statements).
And yet I share this not to diss DeepSeek (which Iâm still curious to test more), but to document this fantastical explanation of markup that is neither minimal nor valid.
If youâre new to this site and my work, minimal valid HTML is exactly what I specialize in and teach. Consider my ebook series about minimal valid HTML, or search my work (âvalid HTMLâ?) for details and commentary on quality HTML. For a quick start, check out my intro on optional HTML and why to write HTMLâHTML.
* âŚwhich Iâm experimenting with locally, aware of some of the concerns.
â As Iâve just started to test DeepSeek, Iâm working with its defaults. The âthinkingâ process that adds so much detail to the response seems to be configurable, at least something that other users have managed to turn off or filter.