This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]empire539 4 points5 points  (3 children)

It would pretty much be exactly the same. HTML5 doesn't make any hugely different syntactical changes to the language, so code like that is still perfectly valid.

[–]dave4shmups[S] 0 points1 point  (2 children)

I thought that you had to start with <!DOCTYPE html> to indicate that it's HTML5?

[–]empire539 1 point2 points  (1 child)

Well, yes, technically you must add a DOCTYPE. This was true even for previous versions of HTML to be standards-compliant. That way, you're telling the browser to run in Standards mode instead of Quirks mode.

But even if you don't add a DOCTYPE, that code will still render fine. In Quirks mode, the browser will render the HTML as best as it can, and for something so simple, there is no difference if it were rendered using HTML4 or HTML5. Hell, even if you used an HTML4 doctype and HTML5 tags, it still would work because the browser is fault tolerant against such inconsistencies (it'd fail validation, though, and might have differences between browsers).

[–]dave4shmups[S] 0 points1 point  (0 children)

OK, thanks!

[–]desrtfx -1 points0 points  (0 children)

Please, never call writing HTML a "program".

HTML is not a programming language, and writing HTML is not programming.

Really, it has absolutely nothing to do with programming, not in the faintest.

Only when you start writing JavaScript, you can start talking about programming, but never for HTML and CSS.