Hacker News new | past | comments | ask | show | jobs | submit login

If it is a truly empty file then no, because that wouldn't validate as a valid html file.

The bare minimum I believe is <HTML></HTML> ...which on its own wouldn't be a HTML quine.




AFAIK in HTML5 you need a doctype and and a non-empty title, but the <html> etc tags are optional:

    <!DOCTYPE html>
    <title>x</title>


Title is actually optional “if the document is an iframe srcdoc document or if title information is available from a higher-level protocol” (such as email). So the minimal valid HTML document is actually just <!doctype html>.


But you don't even need that if you're happy with quirks mode, right?


Right data:text/html,


Sure it is, just serve it with Content-Type: 'plain/text'.


That has nothing to do with HTML. That's an HTTP header.

This thread has a surprising amount of not knowing the difference between HTML and HTTP. The original post is entirely about HTML and does not involve HTTP transmission at all.

HTML <meta> tags are a thing, to invoke browser behavior typically associated with HTTP headers. I'm not sure if that can get you there; I would guess that to visually output the meta tag would require the same * { display:block } shenanigan that the original post is about.


Declaring that it’s not an HTML file is a weird way to claim the smallest valid HTML file.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: