HTML5 Markup Basics
Let's learn about some basic markup for HTML before getting into the advanced stuff.
We'll cover the following...
In the previous chapter, you examined a simple HTML document:
<html><head><title>A simple HTML page</title></head><body><p>I would not have thought it was this easy!</p></body></html>
To tell your browser this document uses HTML5 markup, add the highlighted line to the top:
<!DOCTYPE html><html><head><title>HTML page written in Notepad</title></head><body><p>I would not have thought it is easy!</p></body></html>
Document types
The <!DOCTYPE>
tag announces to the reader and, of course, to the browser, the type of markup to be used when parsing and displaying the document. The <!DOCTYPE html>
code says that the remainder of the document is to be read as HTML5.
The codes for previous markup types were considerably longer, and more complex to write and remember, for example:
XHTML 1.0 Strict:
Press + to interact
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
HTML 4.01
...Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy