Introduction to HTML

HTML is the standard markup language for creating Web pages.

  • HTML stands for Hyper Text Markup Language
  • HTML explains the structure of Web pages using markup
  • HTML elements are the building blocks of HTML pages
  • HTML elements are represented by tags
  • HTML tags are invisible but used to create the page’s content

Sample file

<!DOCTYPE html>
<html>
    <head>
      	<title>Page Title</title>
    </head>
  	<body>
    	<h1>My First Heading</h1>
    	<p>My first paragraph.</p>
 	 </body>
</html>
  • <!DOCTYPE html> declaration defines this document as 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 visible page content
  • The <h1> element defines a broad title
  • The <p> element defines a paragraph

HTML Tags

Tags are the structural labels that surrounds the content to specify the elements. Most of the tags comes as pairs to mark the content’s start and end. End tag has a forward slash before its name.

<tagname>content goes here...</tagname>

Common HTML Tags

  • <h1> – <h6> Heading
  • <p> Paragraph
  • <i> Italic
  • <b> Bold
  • <a> Anchor
  • <ul> & <li> Unordered List & List Item
  • <blockquote> Blockquote
  • <hr> Horizontal Rule
  • <img> Image
  • <div> Division