Fun with HTML5

HTML 5 offers an easy way to begin creating interesting web pages.  All it takes is:

HTML 5 pages start with a doctype declaration (so the browser knows how to interpret it) and includes two main sections:

Simple HTML 5 Page

To make a very simple page, just type or copy the text below into a file and save it as index.html.

<!DOCTYPE html>  
<html>
  <head> 
     <title>My Page Title</title>
  </head> 
  <body> 
      <h3>This is a third-level heading.</h3>
      Try adding more headings 
      or see what happens with h1 or h2 instead. 
  </body> 
</html>

Open your browser. Instead of a website, enter the path to your new index.html, for example:

When you hit enter, the page should appear in your browser.  The title appears up on the tab and the content (from the body) shows in the page.

Less Simple HTML 5 Page

There’s a more interesting single page here:  d3slider.html.

The page references the D3.js library which provides some nice animations.  The code is available on GitHub.  View the contents of the html file.

The page includes some JavaScript code that uses the D3 library.

Embedding Videos

YouTube makes it easy to embed a video in your web page.  Just go to the video you want and select “Share”, then “Embed”, then copy and paste the text into your document and surround it with div tags.   Don’t forget to use a slash in the closing tag! :)

Learn More

A list of all HTML 5 tags is available at: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/HTML5_element_list.

If you find an interesting page, you can often right-click on the page and select “View page source” to see the code behind it.

More information on HTML 5 is available at HTML5 Rocks.

The pages you make are visible from your own computer. If you want to share, you can put the file in Dropbox and share the Dropbox folder - or you can find a place to “host” your web pages