HTML Tags

Definition

  • HTML tags are used to define the structure and content of a webpage.

Types of HTML Tags

(A) Start/Opening Tag & End/Closing Tag :

  • Most of the HTML tags come in pairs like  <h1> and </h1>, <body> and </body>, <head> and </head> and so many others. Here,  <h1>, <body>, <head> etc. are start or opening tags whereas </h1>, </body>, </head> etc. are end or closing tags.

(B) Pair Tags & Unpair  or Empty Tags :

Pair Tags :

    • Those HTML tags which exist with opening and closing tags both are called Pair Tags.
    • For example :- html, head, body, h1, h2, h3, h4, form, table etc. 

Empty Tags/Self-Closing Tags :

    • Those HTML tags which exist with an opening tag but without a closing tag are called Empty Tags.
    • For example :- <br>, <img>, <input>, <link>, <meta>, <hr>,<param> etc. 

HTML Attributes

Definition

  • HTML attributes are used to provide additional information about an HTML element/tag.

Types

  • For simplicity, we can categories the Html attributes in the following major group –

[A]Text Attributes

(a) Common Attributes: These are

action, alt, background, background-color, background-image, background-position, background-repeat, background-size, behavior, charset, read-only, outline, box-shadow, class, text-indent, href, color, content, cursor, data, display, enctype, height, id, margin, method, name, padding, pattern, read-only, src, style, text-align, value, width, etc.

(b) Input Attributes: These are-

autocomplete, autofocus, border, checked, contenteditable, contextmenu, disabled, hidden, list, max, maxlength, min, multiple, placeholder, size, type, vertical-align etc.

(c) Table Attributes: These are

align, bgcolor, border, bordercolor, cellpadding, cellspacing, cols, colspan, frame, hspace, rows, summary, title, vspace etc.

[B] Method Attributes

(a) Common Attributes: These are

onBlur, onChange, onFocus, onInput, onReset, onSelect, onSubmit, etc.

(b) Mouse Attribute: These are

onClick, onDblClick, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, etc.

(c) Key Attribute: These are

onKeyDown, onKeyPress, onKeyUp, etc.

Common HTML Tags/Elements

Here are some of the most commonly used HTML tags:

  1. <html> – Defines the beginning and end of an HTML document.
  2. <head> – Contains information about the document, such as the title and metadata.
  3. <title> – Defines the title of the document that appears in the browser tab.
  4. <body> – Contains the visible content of the document.
  5. <h1> to <h6> – Defines headings of different sizes.
  6. <p> – Defines a paragraph.
  7. <a> – Defines a hyperlink.
  8. <img> – Displays an image.
  9. <ul> – Defines an unordered list.
  10. <ol> – Defines an ordered list.
  11. <li> – Defines a list item.
  12. <table> – Defines a table.
  13. <tr> – Defines a table row.
  14. <td> – Defines a table cell.
  15. <form> – Defines a form for user input.
  16. <input> – Defines an input field, such as a text box or a checkbox.
  17. <select> – Defines a dropdown list.
  18. <option> – Defines an option in a dropdown list.
  19. <button> – Defines a clickable button.
  20. <div> – Defines a section of the webpage that can be styled with CSS.

Loading

Categories: HTML

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.