What is HTML?HyperText Markup Language
<!DOCTYPE html> <html> <title>Your HTML Title</title> <body> <h1>Your heading</h1> <p>Your paragraph.</p> </body> </html>
- The <!DOCTYPE html> declaration defines this document to be HTML5
- The text between <html> and </html> describes an HTML document
- The text between <head> and </head> provides information about the document
- The text between <title> and </title> provides a title for the document
- The text between <body> and </body> describes the visible page content
- The text between <h1> and </h1> describes a heading
- The text between <p> and </p> describes a paragraph
<tagname>content goes here...</tagname>
- HTML tags normally come in pairs like <p> and </p>
- The first tag in a pair is the start tag, the second tag is the end tag
- The end tag is written like the start tag, but with a forward slash inserted before the tag name
It must only appear once, at the top of the page (before any HTML tags).
There are different document types. To display a web page correctly, the browser must know both type and version.
The doctype declaration is not case sensitive. All cases are acceptable:
1. <!DOCTYPE html>
2. <!doctype HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Note: All tutorials and examples at Free Education use HTML5.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">