Learn Basic HTML Complete Course part 3

HTML Tags

HTML tags are like keywords which defines that how web browser will format and display the content. With the help of tags, a web browser can distinguish between an HTML content and a simple content. HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are unclosed tags.

When a web browser reads an HTML document, browser reads it from top to bottom and left to right. HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties.

An HTML file must have some essential tags so that web browser can differentiate between a simple text and HTML text. You can use as many tags you want as per your code requirement.

  • All HTML tags must enclosed within < > these brackets.
  • Every tag in HTML perform different tasks.
  • If you have used an open tag , then you must use a close tag (except some tags)

HTML Tag Examples

Unclosed HTML Tags

Some HTML tags are not closed, for example br and hr.

br Tag: br stands for
break line, it breaks the line of the code.

hr Tag: hr stands for Horizontal Rule. This tag is used to put a line across the webpage.

HTML uses various tags to create the structure of the web page. Every tag is written inside angular brackets <>. Almost every tag also has a corresponding closing tag. Tags are also known as elements.

Tags are of two types-
(a) Container Tags/Elements
(b) Empty Tags/Elements

The tags are discussed below:

(i) <!DOCTYPE html>
This tag is used to tell the web browser that the following text document is a HTML document. There's no need to mention the HTML version.


(ii) <html>
This tag comprises of the complete HTML document and everything in a HTML document needs to be written inside these angular brackets.


(iii) <head>
This tag is used for document's header.


(iv) <title>
This tag is used to mention the title of the document and is placed inside <head> tag.


(v) <body> This tag consists of body of HTML document. It includes other HTML tags like <h1> and <p>.


(vi) <h1>
This tag represents the main heading of the document. A document can have multiple headings and can be denotes as <h2>, <h3>,...,etc.


(vii) <p>
This is a container element and is used to represent the paragraph of the HTML document.

Remaining Tags are as follow... 

HTML Meta Tags

DOCTYPE, title, link, meta and style


HTML Text Tags

<p>, <h1>, <h2>, <h4>, <h4>, <h5>, <h6>,
<strong>, <em>, <abbr>, <acronym>, <address>,
<bdo>, <blockquote>, <cite>, <q>, <code>, <ins>,
<del>, <dfn>, <kbd>, <pre>, <samp>, <var> and <br>


HTML Link Tags

<a> and <base>


HTML Image and Object Tags

<img>, <area>, <map>, <param> and <object>


HTML List Tags

<ul>, <ol>, <li>, <dl>, <dt> and <dd>


HTML Table Tags

<table>, <tr>, <td>, <th>, <tbody>,<thead>,
<tfoot>, <col>, <colgroup> and <caption>


HTML Form Tags

<form>, <input>, <textarea>, <select>, <option>,
<optgroup>, <button>, <label>, <fieldset> and
<legend>


HTML Scripting Tags

<script> </script> and <noscript>



Post a Comment

© Top Blog Pk. All rights reserved. Developed by Jago Desain