Basic Tag

These are basic HTML Tag - Used in a basic html page.

  • <!DOCTYPE> - Defines a document type. It must be declared first top of the HTML document.
    • Usage
      • <!DOCTYPE html> in HTML5,
      • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> in HTML 4.01 Strict,
      • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> in HTML 4.01 Transitional,
      • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> in HTML 4.01 Frameset,
      • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> in XHTML 1.0 Strict,
      • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> in XHTML 1.0 Transitional,
      • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> in XHTML 1.0 Frameset,
      • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> in XHTML 1.0 Strict.
  • <html> - This tag is used at root of html document which tells browser that this is an HTML document. <html> tag is the container all other HTML element in document except <!DOCTYPE>.
    • USAGE :-
      • <html> Other HTML TAG or elements</html>
  • <head> - Head tag is used to define information of document head like title, script, styles, meta information and more.
    • USAGE :-
      • <html><head> title, script, meta, etc </head><body> Body of Document</body></html>
  • <title> - <title> tag is used to define Title of the HTML document.
    • USAGE :-
      • <html><head> <title> Title of document</title> </head><body> Body of Document</body></html>
  • <body> - The <body> tag is used to defines the HTMl document's body. <body> tag is the container all content of HTML document like text, hyperlink, image etc.
    • USAGE:- 
      • <html><head> <title> Title of document</title></head><body> Hello world! </body></html>
  • <h1> to <h6> - Heading in the web page document content are defined by these heading tags (<h1>, <h2>,<h3>,<h4>,<h5>,<h6>).
    • USAGE:-
      • ​​​​​​​​​​​​​​<html><head>​​​​​​​ <title> Title of document</title></head><body> <h1> Hello world! </h1> <h2>Welcome to HTML</h2></body></html>
  • <p> -  The <p> tag is used in HTML to define content in the paragraph form. It also known as paragraph tag.
    • USAGE:-
      • ​​​​​​​​​​​​​​​​​​​​​<html><head>​​​​​​​ <title>Title of document</title></head><body> <p> Hello world! Paragraph. </p></body></html>
  • <br> - The <br> tag is a single line break tag. It is an empty tag which means its no end tag or It is not a conaitner tag.
    • USAGE:- 
      • ​​​​​​​​​​​​​​​​​​​​​<html><head>​​​​​​​ <title>Title</title></head><body> <p> Hello world! <br> Line break in Paragraph. </p></body></html>
  • <hr> -  The <hr> tag is used to separate content in the document changes. This tag also an empty tag.
    • USAGE:-
      • ​​​​​​​​​​​​​​​​​​​​​<html><head>​​​​​​​ <title>document Title</title></head><body> <p> Hello world! <hr> changed content paragraph. </p></body></html>
  • <!--...--> - This tag is used to define comment in the HTML document. 
    • USAGE:-
      • ​​​​​​​​​​​​​​​​​​​​​<html><head>​​​​​​​ <title>document Title</title></head><body> <p> Hello world!  <!-- comment text --> </p></body></html>

More you may like to read