At a minimum, HTML5 includes version 5 of the basic HTML syntax. The sample code in the sidebar on this page shows what this HTML code might look like for a basic Web page. When you're browsing the Web, use the "View source" or similar option in your browser to see the HTML (and other code) loaded to create the page you're currently viewing. All of the code shown in our example is also backward compatible with HTML 4, meaning that it doesn't have any of the new additions available in HTML5.
Though it's not present in all Web pages, it's a good practice to start your HTML file with a document type (doctype) declaration as shown in the example. This confirms that the browser should expect standard HTML when interpreting the document. Some developers rely on extensions to the HTML standard, which use document type definition (DTD) files. If that's the case, the developer specifies the location of the DTD as part of this doctype.
Besides the doctype, the remaining code in the example is standard HTML syntax. If you're not familiar with this syntax, see our article How Web Pages Work.
So, what's new to these basic elements in HTML5? Here's the list, and we'll take a closer look at each in the pages that follow.
- New and updated form elements -- laying out the form structure and processing form input from the user
- Semantic elements -- identifying content based on its role within a Web page
- Media elements -- embedding audio, video and other interactive media without the need for third-party browser extensions
- Ruby elements -- supporting internationalization for Asian language Web pages