Skip to content

Instantly share code, notes, and snippets.

@joechan3
Last active August 20, 2016 04:48
Show Gist options
  • Save joechan3/63cf524210b126fceac4d59230ee976d to your computer and use it in GitHub Desktop.
Save joechan3/63cf524210b126fceac4d59230ee976d to your computer and use it in GitHub Desktop.
joechan3's Basic HTML Template (from Lynda.com - Course: HTML Essential Training with James Williamson)
<html lang="en">: it's basically telling any user agent, that this HTML document is going to be using English for it's language. That's useful for screen readers in terms of how they enunciate the text, it's also very helpful for online translators, so that they know which language they're dealing with.
<meta charset="utf-8">: You always want to set the character encoding, and unless you're using things like Russian alphabet, or Japanese characters, or Kanji or something like that, you're probably going to use utf-8. So, what this is doing, is it's going to inform the user agents which encoding to use.
And that way, it's going to use the proper characters when rendering the page. You also want to do that as the very first thing after the head tag, so it's immediately set. Now you might notice some HTML documents that leave this off altogether. Now that's because there are servers out there, that when they're serving the pages, in the header of the page, they'll also set the character encoding. I want to caution you as an author though, not to rely on that. It's really a good idea to go ahead and set that individually inside each of your HTML documents.
<meta name="description" content="A page for exploring basic HTML documents">: A lot of search engines will use the content that you provide here for search engine results when they're displaying them. It's also useful for your own indexing purposes and searching within your site or content management system.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="A page for exploring basic HTML documents">
<title>Basic HTML document</title>
</head>
<body>
<h1>Page content</h1>
<p>The main page content appears inside the <b>body</b> tag. HTML contains several elements that allow you to properly structure and format your content, which we'll cover later.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment