HTML Tags

HTML Tags are like keywords, which will define how the browser will format and display the content. By using these HTML tags a user can see the difference between HTML content and normal content. There are totally 3 main parts in tags. They are opening tag, content, and closing tag.

HTML Tags

  • All the HTML tags must be enclosed within < > these brackets.
  • Each and every tag in HTML has a different task.

 Syntax: <tag> content </tag>

Example:

<p>Paragraph Tag</p>
<h2>Heading Tag</h2>
<b>Bold Tag</b>
<i>Italic Tag</i>
<u>Underline Tag</u>

Output:

Paragraph Tag

Heading Tag

Bold Tag
Italic Tag
Underline Tag

HTML Documents

  • In HTML, all the documents must start with a document type declaration i.e <!Doctype html>
  • All the HTML tag documents itself begins with <html> and ends with </html>
  • And all the remaining part will be in the middle of the <body> and ends with </body>

HTML Heading Tags

In HTML if you want to start any code, we will be using heading start at first. And these heading tags can be used in different sizes. So, in HTML tags overall we are having six levels of heading such as <h1>, <h2>, <h3>, <h4>, <h5>, <h6>. Check the below example for better understanding of HTML heading tags.

Example:

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4> This is heading 4</h4>
<h5>This is heading 5</h5>
<h6> This is heading 6</h6>

Output:

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

HTML Paragraph Tag

HTML paragraph tags can be defined as <p>. For each paragraph there should be an opening and closing tag.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Paragraph example</title>
</head>
<body>
<p>This is first paragraph</p>
<p>This is second paragraph</p>
</body>
</html>

HTML Meta Tags

Meta tags are nothing but placing the tags inside the head section and providing information regarding author, keywords, or relationships to other documents. All this details are represented using <META> tag attribute.

For using keywords

Example:

<meta name= "keywords" content="freshersnow,freshersnow html meta tags"/>

Description meta

Example:

<meta name="description" content="Learn tutorials from freshersnow site"/>

Refreshing page using meta

An HTML document can be set to refresh after a defined set of the interval using Meta tag of HTML tags.

Example:

<meta http-equiv="refresh" content="10" />

Redirecting a page using meta

HTML documents can be set to refersh after a set of interval using META tag.

Example:

<meta http-equiv="refresh"content="20;url=https://tutorials.freshersnow.com"/>

HTML Link Tag

If you want to add any url of the websites it will be placed between <a> HTML tag.

Example:

<a href="tutorials.freshersnow.com">This is a link</a>

HTML Image Tag

All the HTML images are defined with <img> tag. In this the source file (src), and the alternative text (alt), height, width are provided.

Example:

<img src="tutorials.freshersnow.jpg" alt="tutorials.freshers.com" width="100"height="132">

HTML Line break Tag

If you don’t need opening and closing tags, because there is nothing present to place between them. We should use the <br/> tag for spacing between the characters.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Line Break Example</title>
</head>
<body>
<p>Hey<br/>You received a gift<br/>Thanks<br/>Freshersnow</p>
</body>
</html>

Output:

Hey
You received a gift
Thanks
Freshersnow

List of HTML tags

Here, we are providing a list of all the HTML tags used.

Tag Description
<!–…–> Defines the comment
<!DOCTYPE> Defines the document type
<a> Describes the hyperlink
<abbr> Defines an abbreviation or acronym
<acronym> Defines an acronym. Not supported in HTML5. Use<abbr> instead
<address> Describes the contact information for the author/owner of a document
<applet> Defines an embedded applet. Not supported in HTML5. Use <embed> or <object> instead.
<area> Defines an area inside an image-map
<article> Defines an article
<aside> Describes the content aside from the page content
<audio> Describes the sound content
<b> Describes the bold text
<base> Defines the base URL/target for all relative URLs in a document
<basefont> Specifies a default color, size, and font for all text in a document. Not supported in HTML5. Use CSS instead.
<bdi> Isolates a part of a text which might be formatted in a different direction from other text outside it
<bdo> Overrides the current text direction
<big> Defines big text. Not supported in HTML5. Use CSS instead.
<blockquote> Describes a section that is quoted from another source</td.
<body> Describes the document’s body
<br> Describes a single line break
<button> Describes a clickable button
<canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript)
<caption> Describes a table caption
<center> Describes centered text. Not supported in HTML5. Use CSS instead.
<cite> Describes the title of a work
<code> Describes a piece of computer code
<col> defines column properties for each column within an element
<colgroup> defines a group of one or more columns in a table for formatting
<data> It Links the given content with a machine-readable translation
<datalist> defines a list of pre-defined options for input controls
<dd> Defines a description/value of a term in a description list
<del> Defines text that has been deleted from a document
<details> Describes additional details that the user can view or hide
<dfn> It represents a defining instance of a term
<dialog> Describes a dialog box or window
<dir> Describes the directory list. Not supported in HTML5. Use instead.
<div> Describes a section in a document
<dl> Defines a description list
<dt> Describes a term/name in a description list
<em> Describes the emphasized text
<embed> Describes a container for an external (non-HTML) application
<fieldset> Defines the group’s related elements in a form
<figcaption> Describes a caption for an element
<figure> defines self-contained content
<font> Describes font, color, and size for text. Not supported in HTML5. Use CSS instead.
<footer> Describes a footer for a document or section
<form> Describes an HTML form for user input
<frame> Describes a window (a frame) in a frameset.Not supported in HTML5.
<frameset> specifies a set of frames
<h1> to <h6> Describes HTML headings
<head> Describes information about the document
<header> Describes a header for a document or section
<hr> Describes a thematic change in the content
<html> Describes the root of an HTML document
<i> Describes a part of text in an alternate voice or mood
<iframe> describes the name of the element
<img> Describes an inline frame
<input> Describes an image
<ins> Describes an input control
<kbd> Describes a text that has been inserted into a document
<label> Describes keyboard input
<legend> Describes a label for an element
<li> Describes a list item
<link> Describes the relationship between a document and an external resource
<main> defines the main content of a document
<map> Describes a client-side image-map
<mark> Defines marked/highlighted text
<meta> Defines metadata about an HTML document
<meter> Defines a scalar measurement within a known range (a gauge)
<nav> Defines navigation links
<noframes> Defines an alternate content for users that do not support frames.Not supported in HTML5.
<noscript> Defines an alternate content for users that do not support client-side scripts
<object> Defines an embedded object
<ol> Defines an ordered list
<optgroup> Defines a group of related options in a drop-down list
<option> Defines an option in a drop-down list
<output> Defines the result of a calculation
<p> Defines a paragraph
<param> Defines a parameter for an object
<picture> Defines a container for multiple image resources
<pre> Defines preformatted text
<progress> Represents the progress of a task
<q> Defines a short quotation
<rp> Defines what to show in browsers that do not support ruby annotations
<rt> Defines an explanation/pronunciation of characters
<ruby> Defines a ruby annotation
<s> Defines text that is no longer correct
<samp> Defines sample output from a computer program
<script> Defines a client-side script
<section> Defines a section in a document
<select> Defines a drop-down list
<small> Defines smaller text
<source> Defines multiple media resources for media elements
<span> Defines teletype text. Not supported in HTML5. Use CSS instead.
<strike> Defines strikethrough text
<strong> Defines important text
<style> Defines style information for a document
<sub> Defines subscripted text
<summary> Defines a visible heading for an element
<sup> Defines superscripted text
<svg> Defines a container for SVG graphics
<table> Defines a table
<tbody> Groups the body content in a table
<td> Defines a cell in a table
<template> Defines a template
<textarea> Defines a multiline input control (text area)
<tfoot> Groups the footer content in a table
<th> Defines a header cell in a table
<thead> Groups the header content in a table
<time> Defines a date/time
<title> Defines a title for the document
<tr> Defines a row in a table
<track> Defines text tracks for media elements
<tt> Defines teletype text
<u> Defines text that should be stylistically different from normal text
<ul> Defines an unordered list
<var> Defines a variable
<video> Defines a video or movie
<wbr> Defines a possible line-break