DeepSeek and HTML

Published on March 7, 2025, filed under (RSS feed for all categories).

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 like charset and viewport 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.

Was this useful or interesting? Share this post (e.g., on Mastodon or on Bluesky), and support my work by learning with my ebooks!

About Me

Jens Oliver Meiert, on November 9, 2024.

I’m Jens (long: Jens Oliver Meiert), and I’m a web developer, manager, and author. I’ve worked as a technical lead and engineering manager for small and large enterprises, I’m an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O’Reilly and Frontend Dogma.

I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)