HTML5 is the new version of HTML.
The previous version of HTML was released in 1999, during which time the world wide web has changed a lot and therefore changes were required from HTML.
Many new things have been added in HTML5, so some of the features that were only available in HTML4 using external plugins (such as Adobe Flash) or client-side scripts are now available using regular markup tags.
HTML5 is still in development, but all modern browsers have partial support, so you can use the new features right now.
<video width = ‘300’ height = ‘200’ controls = ‘controls’>
<source src = ‘mountvideo.ogv’ type = ‘video / ogg’ />
<source src = ‘mountvideo.mp4’ type = ‘video / mp4’ />
<source src = ‘mountvideo.webm’ type = ‘video / webm’ />
<audio src = ‘ghost_k-stop.ogv’ controls = ‘controls’> </audio>
The most interesting HTML5 innovations:
Support for video and audio (video and audio elements);
Ability to draw arbitrary objects on web pages (canvas element);
Form improvements (new type values for <input> and many new elements and attributes);
Adding semantic tags to make web pages more understandable for search engines, browsers and other programs and devices that read web pages (footer, header, nav, article elements);
DOM storage is a more functional alternative to cookies.
All HTML5 documents must begin with a DOCTYPE declaration.
Previous versions of HTML had several DOCTYPE types. HTML5 only has one:
<! DOCTYPE html>
This announcement brings all browsers back to normal. Browsers that do not support HTML5 in this mode will interpret old tags and ignore new ones that they do not support.
Creating HTML documents
In order to create an HTML document you need to:
Open any text editor (for example, a notepad built into Windows);
Type arbitrary text and mark it with HTML tags;
Save file with .htm or .html extension.
Now if you open the created file using a web browser it will be displayed as a web page.
Please note: You can download a ready-made HTML document using this link (right-click, select “Save Target As …” in the drop-down menu and select a location to save it) and then simply edit it using any text editor.
HTML document editors
Despite the fact that you can even use a standard text editor (for example, notepad in Windows) to create HTML documents, we do not recommend doing this.
For these purposes, many special editors have been created with tag highlighting and other useful features.
Examples of such editors:
Which extension should I use .htm or .html?
It doesn’t matter, as all modern browsers understand both .htm and .html equally well.
We prefer to use the .html extension because we believe it is the most descriptive, but the final choice is of course yours.
Online editor wisdomweb
We have provided instructions on how to create documents manually in this chapter, but we recommend using our online editor when reading this tutorial.
Using the editor is convenient because:
It has syntax highlighting;
Instantly displays the result of code execution;
Has built-in search and replace functions;
Allows you to execute the exercise code without leaving the pages of our site.