Skip to content

Instantly share code, notes, and snippets.

@cmalven

cmalven/index.html

Last active Oct 12, 2020
Embed
What would you like to do?
Shortest (useful) HTML5 Document
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ -->
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content</p>
</body>
</html>
@ewwink

This comment has been minimized.

Copy link

@ewwink ewwink commented Jan 10, 2015

shortest valid HTML5 that passed http://validator.w3.org

<!doctype html><meta charset=utf-8><title>shortest html5</title>
@paleite

This comment has been minimized.

Copy link

@paleite paleite commented Feb 13, 2015

The last ending tags are implicit and as such, removing them is perfectly valid:

<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content
@muri235

This comment has been minimized.

Copy link

@muri235 muri235 commented Jul 6, 2015

Seems valid in https://validator.w3.org/nu/:

<!doctype html><title>.</title>
@marianzburlea

This comment has been minimized.

Copy link

@marianzburlea marianzburlea commented Nov 13, 2015

<!doctype html>

<title>I'm the shortest valid HTML5</title>
@rbrtmrtn

This comment has been minimized.

Copy link

@rbrtmrtn rbrtmrtn commented Feb 8, 2018

Slight variation with some more whitespace:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>blah</title>
  </head>
  <body>
    <p>I'm the content</p>
  </body>
</html>
@nkpz

This comment has been minimized.

Copy link

@nkpz nkpz commented Mar 3, 2018

If I'm looking for a starting point for a template, this is the most useful for me:

<!doctype html>
<html lang=en>
  <head>
    <meta charset=utf-8>
    <title></title>
  </head>
  <body>
  </body>
</html>

Sure, it's not valid because the title is empty, but I don't need to delete anything to start being productive. Copy, paste, build stuff.

@alemens

This comment has been minimized.

Copy link

@alemens alemens commented Jun 6, 2018

HTML a Basic HTML5 Template For Any Project
starting-html5-template

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">

  <title>The HTML5 Herald</title>
  <meta name="description" content="The HTML5 Herald">
  <meta name="author" content="SitePoint">

  <link rel="stylesheet" href="css/styles.css?v=1.0">

  <!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
  <![endif]-->
</head>

<body>
  <script src="js/scripts.js"></script>
</body>
</html>
@quentint

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.