Structure of Html

HTML Structure

HTML stands for Hyper Text Markup Language. It allows us to organize text, graphics, audio and video on a web page.

<html>
<head>
<title>Page title(aimtocode.com)</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>

Note: Only the content inside the <body> section (the white area above) is displayed in a browser.

Creating HTML Document?

Creating an HTML document is easy. To begin coding HTML you need only two things: a simple-text editor and a web browser. Notepad is the most basic of simple-text editors and you will probably code a fair amount of HTML with it.

  • Open Notepad or another text editor.
  • At the top of the page type <html>.
  • On the next line, indent spaces and now add the opening header tag: <head>.
  • On the next line, indent ten spaces and type <title> </title>.
  • Go to the next line, indent five spaces from the margin and insert the closing header tag: </head>.
  • Five spaces in from the margin on the next line, type <body>.
  • Now drop down another line and type the closing tag right below its mate: </body>.
  • Finally, go to the next line and type </html>.
  • In the File menu, choose Save As.
  • In the Save as Type option box, choose All Files.
  • Name the file template.htm.
  • Click Save.


Example Explained

  • The <!DOCTYPE html> declaration defines this document to be HTML5
  • The <html> element is the root element of an HTML page
  • The <head> element contains meta information about the document
  • The <title> element specifies a title for the document
  • The <body> element contains the visible page content
  • The <h1> element defines a large heading
  • The <p> element defines a paragraph