Basic Tags

Next ❯HTML Attributes

Except few tags,every tags are in pairs

  • Syntax:<html>Start Tag</html>End Tag ("/" before tagname).
  • Tags are like resources, you have to play with this only to create something useful
  • May be some tags are not below, which are removed in HTML5
  • Below are the only Tags which are used now days
Unclosed Tags<br>,<hr>
Document Tag<!DOCTYPE>
Comment Tag<!--...-->
Header Tags<base>,<link>,<meta>,<style>,<title>
Text Tags<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<p>
Text Formatting Tags<b>,<big>,<del>,<i>,<ins>,<strike>,<sup>,<sub>,<small>,<strong>,<tt>,<u>
Phrase Tags<abbr>,<bdo>,<blockquote>,<cite>,<dfn>,<em>,<mark>,<q>,<address>
Computer Code Tags<code>,<kbd>,<pre>,<samp>,<var>
Link Tag<a>
Grouping Tags<div>,<span>
List Tags<dl>,<dt>,<dd>,<li>,<ol>,<ul>
Table Tags<col>,<colgroup>,<caption>,<table>,<tbody>,<td>,<tfoot>,<thead>,<th>,<tr>
Form Tags<button>,<fieldset>,<form>,<label>,<legend>,<input>,<option>,<optgroup>,<select>,<textarea>
Scripting Tags<noscript>,<script>
Image Tags<area>,<img>,<map>
Object Tags<object>,<param>
Frame Tag<iframe>
  • Some Header tags are also Unclosed tags,They don't have any End Tag (Like <base>,<link>,<meta>)
  • <img> tag is also a Unclosed tag
  • we will talk about all tags in coming section.

Unclosed Tags

Elements with no End Tag

  • We are explaining only <br> <hr> here, others are being explained in other tag options

You can write or copy the code in your text editor

  • label_outlineLine Break Tag <br>
    • Used To provide Next Line in a statement
    <!DOCTYPE html>
      <head><title>Line Break Example</title></head>
        <p>Hello,<br>This is a line break Example<br>by<br>Viztro</p>

    This is a line break Example

    • As you see the output above, where <br> tag is used after that all statements are printed on the next line
    • You can use <br> tag anywhere inside the element or outside the element as per your need
  • trending_downHorizontal Line<hr>
    • Used to provide breaking point to the document
    <!DOCTYPE html>
      <head><title>Horizontal Line Example</title></head>
        <p>This is My first Story.....!</p><hr>
        <p>This is My Second Story.....!</p>

    This is My first Story.....!

    This is My Second Story.....!

    • As you see the output above, because of <hr> tag, there is a small bar between the 2 paragraphs
    • You can use <hr> tag, where you want to separate your documents
Browsers Supports
SafariMicrosoft EdgeMozilla FirefoxChromeOpera Mini

Click on the above icon to see the name of the browser !

  • Tips! Always try to use latest version of browser

Document Tag

It defines the document type version.

  • Tag Syntax: <!DOCTYPE...>
  • It should be mentioned at the starting of every HTML document
Doctype Declaration:
  • label_outlineHTML 4.01 Strict
  • label_outlineHTML 4.01 Frameset
    &lt;!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Frameset//EN"
  • label_outlineHTML 4.01 Transitional
    &lt;!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN"
  • label_outlineHTML 5LATEST
    &lt;!DOCTYPE HTML&gt;

    *Now Mostly Websites are using HTML 5

  • HTML Attributes
❮ Prev HTML Elements
Next ❯HTML Attributes