Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love the order of tutorial, starting simple to deploy something first:

1. Use Notepad/TextEdit to create a plain text index.html.

2. Deploy index.html to Neocities or similar.

3. Add content with headings and images.

And only then going back to:

4. Make it proper HTML with <head> and <body>.

5. Upgrade Notepad/TextEdit to Visual Studio Code.



You're probably already aware, but <html>, <head> and <body> is optional in HTML5, so it's a "proper" document without them.


Isn't doctype still required by the spec in HTML5 in order to be "proper"? Perhaps I'm mistaken but I thought I remembered that it's technically 'required'.


The only elements that are absolutely required are doctype and a non-empty title. Most minimal valid HTML doc:

    <!DOCTYPE html>
    <title>Foo</title>


Correct.

Fun fact: you do not need to close most tags in a valid HTML5 document.

This is valid:

    <!DOCTYPE html>
    <title>Foo</title>
    <p>paragraph
    <p>second
    <ul>
        <li>item
    </ul>
    <table>
        <tr><td>hi!
    </table>


Indeed. People writing HTML5 as if it's XHTML is an old pet peeve of mine


It is, but I'd argue that people wouldn't even notice that the document is in quirks mode.

I think you'd really only want a TITLE tag so that it appears as a tab name. Anything else is really optional for people and you'd only really need BR, A, and IMG


It enables quirks mode when missing.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: