HTML Tags


What is HTML Tags

HTML tags are special codes used in Hypertext Markup Language (HTML) to define the structure and content of a web page. HTML tags are enclosed in angle brackets (< and >) and are used to define various elements such as headings, paragraphs, links, images, lists, forms, tables, and more. Each HTML tag defines a specific element and its attributes, which can be used to control the appearance and behavior of the element on the page.


Here are some common HTML tags:

  • <!DOCTYPE html>:  Defines the document type as HTML5.
  • <html>: Defines the beginning and end of an HTML document.
  • <head>: Contains metadata about the document, including the title and links to external stylesheets and scripts.
  • <title>: Defines the title of the document, which appears in the browser tab and search results.
  • <body>: Contains the visible content of the document, including text, images, and other media.
  • <h1> to <h6>: Defines headings of different sizes, with <h1> being the largest and <h6> being the smallest.
  • <p>: Defines a paragraph of text.
  • <a>: Defines a hyperlink, with the href attribute specifying the URL of the link.
  • <img>: Defines an image, with the src attribute specifying the URL of the image and the alt attribute providing alternative text for screen readers.
  • <ul> and <ol>: Define unordered and ordered lists, respectively.
  • <li>: Defines a list item within a list.
  • <table>: Defines a table, with <tr> defining a row and <td> defining a cell within a row.
  • <form>: Defines a form for user input, with <form> defining different types of form controls, such as text fields and checkboxes.
  • <input>: Creates an  <input> field for some input.
  • <label>: associates a <label> with an input element.
  • <select>: creates a dropdown list.
  • <option>: defines an <option> in a dropdown list.
  • <button>: creates a clickable <button> 
  • <textarea>: creates a multi-line input field for user input. 
  • <fieldset>: groups related form elements together.
  • <legend>: defines a caption for a <fieldset>

There are many more HTML tags available, but these are some of the most commonly used ones.