Remix.run Logo
yawaramin 6 hours ago

> This is honestly all you need.

No, you need less than that! :-)

    ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
    │                     how-to-make-a-damn-website.html                      │
    ├──────────────────────────────────────────────────────────────────────────┤
    │ <title>How to Make a Damn Website</title>                                │
    │ <h1>How to Make a Damn Website</h1>                                      │
    │                                                                          │
    │                                                                          │
    │ <p>A lot of people want to make a website but don’t know where to start  │
    │ or they get stuck.</p>                                                   │
    ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
HTML is very forgiving! You can start really simple and work your way up to more complexity when you need it.
susam 6 hours ago | parent | next [-]

Web browsers are indeed forgiving when it comes to incomplete HTML. Some time ago, I did a small experiment to see what minimal HTML is required to display a simple 'Hello' page while adhering to the specification, passing HTML Tidy validation and also satisfying the Nu HTML Checker. As far as I can tell, it is this:

  <!DOCTYPE html>
  <html lang="en">
  <meta charset="UTF-8">
  <title>Hello</title>
  <body>
  <p>Hello!
Remove any tag and the validation fails. Here is how the Tidy check looks:

  $ tidy -qe minimal.html
  $
And here's a Nu check link: https://validator.w3.org/nu/?doc=https%3A%2F%2Fsusam.net%2Fc...
SahAssar 5 hours ago | parent [-]

The body tag is unnecessary, tidy might complain but that is not the spec. The meta tag is generally unnecessary (the content encoding should be set by the server in the headers since it applies to not just HTML). The html tag is unnecessary if you do not want to declare the language of the document (which is generally a warning).

So I guess smallest without errors should be

    <!DOCTYPE html><title>a</title>
And smallest without errors or warnings should be

    <!DOCTYPE html><html lang><title>a</title>
And then any content that is not links, scripts, meta tags, etc. will automatically be within a body after like

    <!DOCTYPE html><html lang><title>a</title><p>a
layer8 6 hours ago | parent | prev [-]

To be mobile-friendly, I’d remove the block-drawing characters. ;)