HTML Tags
HTML tags are special keywords enclosed in angle brackets (<>) that define elements in an HTML document. Most tags come in pairs:
- Opening tag: <tagname>
- Closing tag: </tagname>
- Some tags are self-closing: <tagname />
HTML tags are categorized into two main types based on whether they require a closing tag or not:
- 1️⃣ Paired Tags (Container Tags)
- 2️⃣ Singular Tags (Self-Closing Tags)
Paired Tags (Container Tags)
🔹 Definition: These tags must have both an opening and a closing tag.
🔹 Syntax: <tagname> Content </tagname>
🔹 Example: <p>Hello World</p>, <h1>Heading</h1>
Singular Tags (Self-Closing Tags)
🔹 Definition: These tags do not require a closing tag.
🔹 Syntax: <tagname /> (In HTML5, the / at the end is optional)
🔹 Example: <br>, <img>, <hr>, <input>