HTML Java

HTML Introduction


What is HTML?

HTML is the standard markup language for creating Web pages.

  • HTML stands for Hyper Text Markup Language.
  • HTML describes the structure of a Web page.
  • HTML consists of a series of elements.
  • HTML elements tell the browser how to display the content.
  • HTML elements are represented by tags.
  • HTML tags label pieces of content such as "heading", "paragraph", "table", and so on.

Note: Browsers do not display the HTML tags, but use them to make the content of the page.


Example

<html>
<head>

  <title>Page Title</title>

</head>
<body>

  <h1>This is a heading</h1>
  <p>This is a paragraph</p>

</body>
</html>
Try it »

Example Explained

  • 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.


HTML Versions

HTML was introduced in the year 1991 by Tim Berners-Lee. Since then there have been many versions of HTML:

Version Year
HTML 1991
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 2000
HTML5 2014


Applications of HTML

HTML is one of the most widely used language over the web.

  • Web pages development - HTML is used to create pages which are displayed over the web. Almost every page of web is having html tags in it to provide its details in browser.
  • Internet Navigation - HTML provides tags which are used to navigate from one page to another and is heavily used in internet navigation.
  • Responsive UI - HTML pages now-a-days works well on all platform, mobile, tabs, desktop or laptops owing to responsive design strategy.
  • Offline support - HTML pages once loaded can be made available offline on the machine without any need of internet.


HTML Tags

HTML tags are element names surrounded by angle brackets <Tag Name>:

Syntax: - <tagname> html contents...</tagname>

  • Except a few, usually tags come in pairs.
  • The first tag is called a start tag, and the second tag is called the end tag.
  • The end tag is written like the start tag, but with a forward slash inserted before the tag name.

Note: - The start tag is also called the opening tag, and the end tag as closing tag.



HTML Page Structure

<html>
   <head>
     <title>Page Title</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 is displayed in browser.