Describe basic structure of HTML page

HTML (Hypertext Markup Language) is a markup language used to create web pages. Any HTML page should follow certain rules to be properly displayed in web browsers: to declare proper Document Type, to include key components such as <html>, <head>, <body> tags.

Here is structure of primitive webpage described with HTML markup language:

<!DOCTYPE html>
    <title>This is a title</title>
    <p>Hello world!</p>
  • <!DOCTYPE html> is the Document Type Declaration (HTML5 version). If a declaration is not included, browsers will have issues with rendering webpage (so called "quirks mode").
  • <html> tag should frame the entire page. Tells the browser that this is an HTML document.
  • <head> tag contains various information, which is not visible on webpage but is important to web browser to correctly display and handle it. Usually it describes purpose, content and settings of webpage with <meta/> tags and also might contain links to CSS and JavaScript files, which are used within page. <title> element is one of such descriptive tags, which tells web browser how to name your webpage (visible as the name of the tab or window in browser).
  • <body> element is where actual webpage content is stored. In example above content of page presented as <p> (paragraph) with text "Hello world!".

Similar articles