Tags in HTML
HTML tags are like keywords that define how web browser will format and display the content. Using 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.
Document structure tag:
-
HTML tag: It is the root of the html document which is used to specify that the document is html.
Syntax:
<html> Statements... </html>
-
Head tag: Head tag is used to contain all the head element in the html file. It contains the title, style, meta, … etc tag.
Syntax:
<head> Statements... </head>
-
Body tag: It is used to define the body of html document. It contains image, tables, lists, … etc.
Syntax:
<body> Statements... </body>
-
Title tag: It is used to define the title of html document.
Syntax:
<title> Statements... </title>
Content container tag:
-
Heading tag: It is used to define the heading of html document.
Syntax:
<h1> Statements... </h> <h2> Statements... </h2> <h3> Statements... </h3> <h4> Statements... </h4> <h5> Statements... </h5> <h6> Statements... </h6>
-
Paragraph tag: It is used to define paragraph content in html document.
Syntax:
<p> Statements... </p>
-
Emphasis tag: It is used to renders as emphasized text.
Syntax:
<em> Statements... </em>
-
Bold tag: It is used to specify bold content in html document.
Syntax:
<b> Statements... </b>
-
Italic tag: It is used to write the content in italic format.
Syntax:
<i> Statements... </i>
-
Small (text) tag: It is used to set the small font size of the content.
Syntax:
<small> Statements... </small>
-
Underline tag: It is used to set the content underline.
Syntax:
<u> Statements... </u>
-
Deleted text tag: It is used to represent as deleted text. It cross the text content.
Syntax:
<strike> Statements... </strike>
-
Anchor tag: It is used to link one page to another page.
Syntax:
<a href="..."> Statements... </a>
-
List tag: It is used to list the content.
Syntax:
<li> Statements... </li>
-
Ordered List tag: It is used to list the content in a particular order.
Syntax:
<ol> Statements... </ol>
-
Unordered List tag: It is used to list the content without order.
Syntax:
<ul> Statements... </ul>
-
Comment tag: It is used to set the comment in html document. It is not visible on the browser.
Syntax:
<!-- Statements... -->
-
Scrolling Text tag: It is used to scroll the text or image content.
Syntax:
<marquee> Statements... </marquee>
-
Center tag: It is used to set the content into the center.
Syntax:
<center> Statements... </center>
-
Font tag: It is used to specify the font size, font color and font-family in html document.
Syntax:
<font> Statements ... <font>
-
Form tag: It is used to create html form for user.
Syntax:
<form> Statements ... <form>
-
Submit input tag: It is used to take the input from the user.
Syntax:
<input>
-
Dropdown option tag: It is used to select an option froma drop-down list.
Syntax:
<option> Statements ... <option>
-
Radio button tag: It is used to select only one option from the given options.
Syntax:
<input>