What is HTML 5?
HTML 5 is a new specification of HTML designed to follow HTML 4.01 and was created by designers who were not satisfied with the direction the W3C was taking HTML with the advent of XHTML 1.0. HTML 5 adds features to help web application developers and to improve the interoperability among web browsers and user agents.
There are lots of new features to HTML 5 including:
- Tags to help with the structure of your pages like section, article, and aside.
- New form tags to get more specific data in your forms
- Multimedia tags to assist you in adding video and audio to your web pages.
- Plus, some tags have been removed from the specification.
HTML 5 Doctype
The first thing you should know about HTML 5 is how to tell browsers you’re using it. You do this by using the correct doctype:
<!doctype html>
Building an HTML 5 Page:
Put the doctype as the first line in your HTML document. Then add the <html> tag and start the <head> of your document. Inside the head, you should indicate the title of your document and the character set:
<html>
<head>
<title>My First HTML 5 Document</title>
<meta charset="UTF-8">
</head>
Write your HTML 5 document with the same tags as you would an HTML 4.01 document. Put your content in the <body> tag and close both the body tag and the html tag at the very bottom of the document.
Here is a sample HTML 5 document:
<!doctype html>
<html>
<head>
<title>My First HTML 5 Document</title>
<meta charset="UTF-8">
</head>
<body>
<p>Put your HTML 5 tags here</p>
</body>
</html>
ساحة النقاش